/* ============================================================
   supplychain.watch — evolved-minimal watchpost
   Broken grid. Serif classic. Muted palette. Icon-heavy.
   ============================================================ */

:root {
    /* Palette */
    --paper:      #FAFAF6;
    --ink:        #2C2C2C;
    --blue:       #5B7B9A;
    --clay:       #B8956A;
    --sage:       #7A8B72;
    --fog:        #C4C0B8;
    --parchment:  #F0ECE4;

    /* Type */
    --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-body:    "Source Serif 4", Georgia, serif;
    --font-label:   "DM Sans", "Helvetica Neue", Arial, sans-serif;

    /* Rhythm */
    --gap-tight:  24px;
    --gap-wide:   120px;
    --grid-gap:   16px;

    /* Broken-grid offsets (adjustable responsively) */
    --offset-40:  40px;
    --offset-60:  60px;
    --offset-80:  80px;
    --offset-120: 120px;
}

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

html {
    scroll-behavior: smooth;
    background: var(--paper);
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

ul, ol {
    list-style: none;
}

/* ------------------------------------------------------------ */
/* Typography                                                   */
/* ------------------------------------------------------------ */
.heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 1.25rem;
    max-width: 22ch;
}

.body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--ink);
    max-width: 58ch;
}

.body + .body {
    margin-top: 1.1rem;
}

.body--sm {
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 32ch;
}

.body--quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.1rem, 1.6vw, 1.35rem);
    line-height: 1.55;
    color: var(--blue);
    max-width: 48ch;
    border-left: 1px solid var(--fog);
    padding-left: 1.4rem;
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--fog);
    margin-bottom: 1.6rem;
}

.icon-label,
.meta-label {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
}

.meta-sep {
    font-family: var(--font-label);
    font-size: 0.72rem;
    color: var(--fog);
    margin: 0 0.6rem;
    letter-spacing: 0.08em;
}

/* ------------------------------------------------------------ */
/* Grid                                                         */
/* ------------------------------------------------------------ */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--grid-gap);
    width: 100%;
}

/* ------------------------------------------------------------ */
/* Hero: Observation aperture                                   */
/* ------------------------------------------------------------ */
.aperture {
    position: relative;
    min-height: 100vh;
    width: 100%;
    background: var(--paper);
    padding: 4rem 6vw;
    overflow: hidden;
}

.aperture__cluster {
    position: absolute;
    top: 9%;
    right: 8%;
    display: grid;
    grid-template-columns: repeat(2, auto);
    grid-template-rows: repeat(2, auto);
    gap: 14px 18px;
    align-items: center;
    color: var(--ink);
    opacity: 0.78;
}
.aperture__cluster .cluster-icon {
    width: 26px;
    height: 26px;
}
.aperture__cluster .cluster-icon:nth-child(1) { grid-column: 1 / 3; justify-self: center; }
.aperture__cluster .cluster-icon:nth-child(2) { grid-column: 1; }
.aperture__cluster .cluster-icon:nth-child(3) { grid-column: 2; }

.aperture__brand {
    position: absolute;
    left: 10%;
    top: 65%;
    right: 0;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.brand {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: var(--ink);
    white-space: nowrap;
}

.brand__line {
    flex: 1 1 auto;
    display: block;
    height: 1px;
    background: var(--ink);
    align-self: center;
    margin-right: 0;
    transform-origin: left center;
    animation: line-draw 2.2s ease-out 0.4s both;
}

@keyframes line-draw {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.aperture__meta {
    position: absolute;
    left: 10%;
    top: 65%;
    margin-top: 4.4rem;
    display: flex;
    align-items: center;
}

/* ------------------------------------------------------------ */
/* Section shell                                                */
/* ------------------------------------------------------------ */
.section {
    width: 100%;
    padding: var(--gap-wide) 6vw;
    position: relative;
    background: var(--paper);
}

.section--tight    { padding-top: var(--gap-tight); padding-bottom: var(--gap-wide); }
.section--wide     { padding-top: var(--gap-wide);  padding-bottom: var(--gap-wide); }
.section--parchment { background: var(--parchment); }
.section--close    { padding-bottom: var(--gap-tight); }

.section__inner {
    max-width: 1480px;
    margin: 0 auto;
}

/* ------------------------------------------------------------ */
/* Blocks (broken-grid units)                                   */
/* ------------------------------------------------------------ */
.block {
    position: relative;
    grid-row: 1;
}

.block--text    {}
.block--icon {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    grid-row: 1;
}

/* Vertical offsets that create the broken grid */
.block--offset-40  { margin-top: var(--offset-40);  }
.block--offset-60  { margin-top: var(--offset-60);  }
.block--offset-80  { margin-top: var(--offset-80);  }
.block--offset-120 { margin-top: var(--offset-120); grid-row: 2; }

/* ------------------------------------------------------------ */
/* Icons                                                        */
/* ------------------------------------------------------------ */
.icon {
    display: block;
    color: var(--ink);
    flex: none;
}
.icon-sm { width: 48px;  height: 48px;  }
.icon-md { width: 120px; height: 120px; }
.icon-lg { width: 240px; height: 240px; }

.ink   { color: var(--ink); }
.blue  { color: var(--blue); }
.clay  { color: var(--clay); }
.sage  { color: var(--sage); }
.fog   { color: var(--fog); }

/* Glyph alphabet grid (Vocabulary section) */
.glyphs {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
    max-width: 42rem;
}

.glyphs li {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
}

/* ------------------------------------------------------------ */
/* Connectors (thin-line structural skeleton)                   */
/* ------------------------------------------------------------ */
.connector {
    display: block;
    align-self: center;
    background: var(--fog);
}
.connector--h {
    height: 1px;
    width: 100%;
    margin-top: 80px;
}
.connector--v {
    width: 1px;
    height: 80%;
    margin: 40px auto;
    justify-self: center;
}

/* ------------------------------------------------------------ */
/* Dividers (cultural motifs)                                   */
/* ------------------------------------------------------------ */
.divider {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: var(--gap-tight) 6vw;
    background: var(--paper);
}

.divider--wide { padding: calc(var(--gap-wide) * 0.5) 6vw; }

.motif {
    color: var(--fog);
    opacity: 0.55;
}
.motif--compass  { width: 80px;  height: 80px;  }
.motif--waves    { width: 320px; height: 40px;  }
.motif--mountain { width: 320px; height: 60px;  }

/* ------------------------------------------------------------ */
/* Stations                                                     */
/* ------------------------------------------------------------ */
.station {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: flex-start;
    max-width: 22rem;
}

.station .icon-label { color: var(--blue); }

/* ------------------------------------------------------------ */
/* Ledger                                                       */
/* ------------------------------------------------------------ */
.ledger-entries {
    margin-top: 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    border-top: 1px solid var(--fog);
    padding-top: 1.6rem;
}

.ledger-entries li {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: baseline;
    gap: 1.4rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--fog);
}

.ledger-date {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--blue);
    text-transform: uppercase;
}

.ledger-entry {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
}

/* ------------------------------------------------------------ */
/* Address                                                      */
/* ------------------------------------------------------------ */
.address {
    margin-top: 2rem;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.6vw, 1.4rem);
    color: var(--ink);
    line-height: 1.9;
}
.address .icon-label {
    color: var(--fog);
}
.address .at {
    color: var(--blue);
    padding: 0 0.15rem;
}

/* ------------------------------------------------------------ */
/* Watchmark (footer)                                           */
/* ------------------------------------------------------------ */
.watchmark {
    width: 100%;
    padding: 3rem 6vw 4rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    border-top: 1px solid var(--fog);
    background: var(--paper);
}

/* ------------------------------------------------------------ */
/* Typewriter effect                                            */
/* ------------------------------------------------------------ */
.typewriter .tw-char {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}

.typewriter.is-revealing .tw-char,
.typewriter.is-revealed  .tw-char {
    opacity: 1;
}

/* preserve whitespace boundaries */
.typewriter .tw-space { display: inline; white-space: pre; }

/* ------------------------------------------------------------ */
/* Subtle entrance: blocks fade in on scroll                    */
/* ------------------------------------------------------------ */
.block, .station, .divider, .ledger-entries {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.is-visible.block,
.is-visible.station,
.is-visible.divider,
.is-visible.ledger-entries {
    opacity: 1;
    transform: none;
}

/* Hero always visible */
.aperture .brand,
.aperture .aperture__meta,
.aperture .aperture__cluster {
    opacity: 1;
    transform: none;
}

/* ------------------------------------------------------------ */
/* Responsive: collapse broken grid to single centered column  */
/* ------------------------------------------------------------ */
@media (max-width: 768px) {
    :root {
        --grid-gap: 12px;
        --gap-wide: 72px;
    }

    .aperture {
        padding: 3rem 7vw;
    }
    .aperture__cluster {
        top: 7%;
        right: 7%;
        gap: 10px 14px;
    }
    .aperture__cluster .cluster-icon { width: 22px; height: 22px; }

    .aperture__brand {
        left: 7%;
        right: 7%;
        top: 58%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    .brand__line { width: 40%; }

    .aperture__meta {
        left: 7%;
        top: 58%;
        margin-top: 6.2rem;
    }

    .grid-12 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .block,
    .station {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        margin-top: 0 !important;
        max-width: 100%;
    }

    .block--icon,
    .station {
        align-items: center;
        text-align: center;
    }
    .block--text {
        text-align: left;
    }
    .block--icon .icon-lg {
        width: 150px;
        height: 150px;
    }

    .glyphs {
        grid-template-columns: repeat(3, 1fr);
    }

    .connector { display: none; }

    .ledger-entries li {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .divider { padding: 2rem 6vw; }
    .motif--waves, .motif--mountain { width: 220px; }
}

@media (max-width: 480px) {
    .glyphs {
        grid-template-columns: repeat(2, 1fr);
    }
    .brand {
        white-space: normal;
    }
}
