@font-face {
  font-family: "Compagnon Light";
  src: url("/fonts/compagnon-light.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Terminal Grotesque";
  src: url("/fonts/terminal-grotesque.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
    --br-blue: #2b7de0;
    --br-grid: #dceeff;
    --br-yellow: #dcb045;
    --font-pixel: "Terminal Grotesque", sans-serif;
    --font-serif: "Compagnon Light", serif;
    --br-grid-size: 40px;
}

@keyframes slideDownFade {
    0% {
        opacity: 0;
        transform: translateY(-30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes growBar {
    from { transform: scaleX(0); opacity: 0.5; }
    to { transform: scaleX(1); opacity: 1; }
}

/**
 * Header with the grid pattern background used by the Buildroot LTS
 *   graphical chart
 */
.br-lts-header {
    margin-top: 50px;
    position: relative;
    width: 100%;
    min-height: 400px;
    background-color: #ffffff;
    overflow: hidden;
    border-bottom: 4px solid var(--br-blue);
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.br-lts-header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--br-grid) 2px, transparent 2px),
        linear-gradient(90deg, var(--br-grid) 2px, transparent 2px);
    background-size: 120px 120px;
    z-index: 1;
    pointer-events: none;
}

.br-lts-header-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

.br-lts-header-title {
    color: var(--br-blue);
    font-family: var(--font-pixel);
    font-size: 8rem;
    display: inline-block;
    background: white;
    padding: 10px;
    margin: 10px;
    border: 2px solid var(--br-blue);
    box-shadow: 6px 6px 0 var(--br-blue);

    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 0;
    animation: slideDownFade 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.br-lts-header-title:nth-of-type(2) {
    font-size: 6rem;
    line-height: 6rem;
    animation-delay: 0.2s;
}

.br-lts-header-title:hover {
    background-color: var(--br-blue);
    color: #ffffff;
    box-shadow: 8px 8px 0 var(--br-grid);
    transform: translateY(-2px) translateX(-2px);
}

/**
 * <main> wrapper.
 */
.br-lts-main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/**
 * Custom dotted separator using the BR-LTS theme.
 */
.br-lts-separator {
    width: 100%;
    max-width: 900px;
    height: 10px;
    border-bottom: 2px dotted var(--br-blue);
    margin: 10px 0;
}

/**
 * Intersection subtitle <div> with grid background
 */
.br-lts-section-header {
    position: relative;
    width: 40%;
    height: calc(var(--br-grid-size) * 3);
    background-color: #fff;
    display: flex;
    align-items: center;
    padding-left: var(--br-grid-size);
    margin: var(--br-grid-size) 0;
    border: 2px solid var(--br-grid);

    text-decoration: none;
    cursor: pointer;
    scroll-margin-top: 20px; /* Offset for jump to anchor */
}

.br-lts-section-header:hover {
    border: 2px solid var(--br-blue);
    box-shadow: 6px 6px 0 var(--br-blue);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.br-lts-section-header .br-lts-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(var(--br-grid) 2px, transparent 2px),
        linear-gradient(90deg, var(--br-grid) 2px, transparent 2px);
    background-size: var(--br-grid-size) var(--br-grid-size);
    background-position: -1px -1px;
    z-index: 1;
    pointer-events: none;
}

.br-lts-section-header .br-lts-title-box {
    position: relative;
    z-index: 10;
    background-color: #fff;
    border: 2px solid var(--br-blue);
    color: var(--br-blue);
    font-family: var(--font-pixel);
    font-weight: 400;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    padding: 10px 15px;
}

.br-lts-section-header .br-lts-decoration-dot {
    position: absolute;
    z-index: 10;
    width: 10px;
    height: 10px;
    background-color: var(--br-yellow);
    border-radius: 50%;
    bottom: 0;
    left: 0;
    transform: translate(-50%, 50%);
}

/**
 * Numbered titled list.
 * The number is spanning on the left.
 * The content is on this right.
 */
.br-lts-item-row {
    display: flex;
    gap: 25px;
    max-width: 900px;
    position: relative;
}

.br-lts-item-number {
    font-family: var(--font-pixel);
    color: var(--br-yellow);
    font-size: 160px;
    line-height: 0.8;
    flex-shrink: 0;
    user-select: none;
    margin-top: 20px;
    text-align: center;
    width: 60px;
}

.br-lts-item-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 5px;
}

.br-lts-item-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 300;
    font-size: 42px;
    line-height: 1.1;
    color: var(--br-blue);
    letter-spacing: 1px;
}

.br-lts-item-text {
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    max-width: 750px;
}

/**
 * 'timeline' grid to represent how tasks are expanding across time.
 */
.br-lts-chart {
    display: grid;
    grid-template-columns: 120px repeat(12, 1fr);
    gap: 0;
    width: 100%;
    max-width: 1000px;
    background-color: #fff;
    border: 2px solid var(--br-blue);
    box-shadow: 6px 6px 0 var(--br-blue);
    position: relative;
    overflow-x: auto;
}

.br-lts-chart::before {
    content: "";
    position: absolute;
    top: 45px;
    left: 120px;
    right: 0;
    bottom: 0;
    background-size: calc(100% / 12) 100%;
    z-index: 0;
    pointer-events: none;
}

.br-lts-chart-head {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 120px repeat(12, 1fr);
    border-bottom: 2px solid var(--br-blue);
    background-color: color-mix(in srgb, var(--br-blue) 6%, white);
    font-weight: bold;
    position: relative;
    z-index: 2;
}

.br-lts-chart-head-label {
    text-align: center;
    padding: 10px;
    border-left: 2px solid var(--br-grid);
    font-family: var(--font-pixel);
    font-size: 20px;
    color: var(--br-blue);
}

.br-lts-span-year { grid-column: span 4; }
.br-lts-span-day { grid-column: span 2; }
.br-lts-head-spacer { grid-column: span 1; border-right: 2px solid var(--br-blue); }

.br-lts-chart-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 120px repeat(12, 1fr);
    align-items: center;
    height: 50px;
    border-bottom: 1px dashed #ddd;
    position: relative;
    z-index: 1;
    transition: background-color 0.2s ease;
}

.br-lts-chart-row:last-child { border-bottom: none; }

.br-lts-chart-row--tall {
    height: 100px;
}

.br-lts-chart-row--faded {
    color: #999;
    font-style: italic;
}

.br-lts-chart-row:hover {
    background-color: color-mix(in srgb, var(--br-blue) 8%, transparent);
    z-index: 2;
}

.br-lts-chart-label {
    padding: 0 15px;
    font-weight: bold;
    color: #555;
    border-right: 2px solid var(--br-blue);
    height: 100%;
    display: flex;
    align-items: center;
    background-color: #fff;
    font-size: 14px;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.br-lts-chart-row:hover .br-lts-chart-label {
    background-color: transparent;
    color: var(--br-blue);
}

.br-lts-bar {
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding-left: 10px;
    font-size: 12px;
    color: white;
    font-weight: bold;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    background-color: var(--br-blue);
    grid-column-end: span 1;
    cursor: default;

    transform-origin: left center;
    animation: growBar 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;

    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.2s ease,
                filter 0.2s ease;
}

.br-lts-chart-row:nth-child(2) .br-lts-bar { animation-delay: 100ms; }
.br-lts-chart-row:nth-child(3) .br-lts-bar { animation-delay: 200ms; }
.br-lts-chart-row:nth-child(4) .br-lts-bar { animation-delay: 300ms; }
.br-lts-chart-row:nth-child(5) .br-lts-bar { animation-delay: 400ms; }
.br-lts-chart-row:nth-child(6) .br-lts-bar { animation-delay: 500ms; }
.br-lts-chart-row:nth-child(7) .br-lts-bar { animation-delay: 600ms; }
.br-lts-chart-row:nth-child(8) .br-lts-bar { animation-delay: 700ms; }
.br-lts-chart-row:nth-child(9) .br-lts-bar { animation-delay: 800ms; }
.br-lts-chart-row:nth-child(10) .br-lts-bar { animation-delay: 900ms; }
.br-lts-chart-row:nth-child(11) .br-lts-bar { animation-delay: 1000ms; }

.br-lts-bar:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 4px 6px 12px rgba(0,0,0,0.2);
    z-index: 10;
    filter: brightness(1.1);
}

.br-lts-bar--long {
    background-color: var(--br-yellow);
    color: color-mix(in srgb, var(--br-yellow), black 45%);
    grid-column-end: span 12;
    border: 2px solid color-mix(in srgb, var(--br-yellow), white 20%);
}

.br-lts-bar--span-2 { grid-column-end: span 2; }
.br-lts-bar--span-6 { grid-column-end: span 6; }

.br-lts-col-start-2 { grid-column-start: 2; }
.br-lts-col-start-3 { grid-column-start: 3; }
.br-lts-col-start-4 { grid-column-start: 4; }
.br-lts-col-start-5 { grid-column-start: 5; }
.br-lts-col-start-6 { grid-column-start: 6; }
.br-lts-col-start-7 { grid-column-start: 7; }
.br-lts-col-start-8 { grid-column-start: 8; }
.br-lts-col-start-9 { grid-column-start: 9; }
.br-lts-col-start-10 { grid-column-start: 10; }
