:root {
    color-scheme: light;
    --ink: #101820;
    --ink-soft: #26343d;
    --paper: #f5f3eb;
    --white: #fffefa;
    --muted: #617079;
    --line: #ced3cc;
    --teal: #00a896;
    --teal-dark: #007b70;
    --coral: #f15b4c;
    --yellow: #f7c948;
    --blue: #3d6bb3;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: var(--white);
    background: var(--ink);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    display: grid;
    width: 100%;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 24px clamp(24px, 5vw, 72px);
    color: var(--white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    text-decoration: none;
}

.wordmark > span {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--ink);
    background: var(--yellow);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.86rem;
    font-weight: 800;
}

.wordmark small {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

nav {
    display: flex;
    gap: 28px;
}

nav a,
.contact-link {
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

nav a {
    color: rgba(255, 255, 255, 0.72);
}

nav a:hover,
nav a:focus-visible {
    color: var(--white);
}

.contact-link {
    justify-self: end;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--teal);
}

.hero {
    position: relative;
    display: grid;
    min-height: 720px;
    grid-template-columns: minmax(0, 1.45fr) minmax(250px, 0.55fr);
    grid-template-rows: 1fr auto;
    overflow: hidden;
    padding: 156px clamp(24px, 7vw, 112px) 56px;
    color: var(--white);
    background: var(--ink);
}

.hero::before {
    position: absolute;
    top: 21%;
    right: -5%;
    width: min(39vw, 520px);
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    content: "";
}

.hero::after {
    position: absolute;
    top: 34%;
    right: 4%;
    width: min(23vw, 320px);
    aspect-ratio: 1;
    border: 1px solid var(--teal);
    content: "";
    transform: rotate(45deg);
}

.hero-grid {
    position: absolute;
    inset: 0;
    opacity: 0.085;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.7) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to right, #000, transparent 74%);
}

.hero-content {
    position: relative;
    z-index: 2;
    align-self: center;
    max-width: 920px;
}

.kicker,
.section-number {
    margin: 0 0 24px;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.68);
}

.kicker span {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 5px rgba(0, 168, 150, 0.15);
}

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

h1 {
    max-width: 930px;
    margin-bottom: 28px;
    font-size: 7.4rem;
    font-weight: 800;
    line-height: 0.86;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 span {
    display: block;
    margin-bottom: 14px;
    color: var(--yellow);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.16em;
    line-height: 1;
    text-transform: none;
}

.hero-copy {
    max-width: 650px;
    margin-bottom: 32px;
    color: #bdc7ca;
    font-size: 1.25rem;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 28px;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 18px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

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

.button-primary:hover,
.button-primary:focus-visible {
    color: var(--white);
    background: var(--teal-dark);
}

.text-link {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.query-line {
    position: absolute;
    z-index: 2;
    right: clamp(24px, 5vw, 72px);
    bottom: 174px;
    display: grid;
    width: min(39vw, 500px);
    min-height: 88px;
    grid-template-columns: auto 1fr;
    align-content: center;
    gap: 7px 16px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 3px solid var(--coral);
    background: rgba(16, 24, 32, 0.82);
    box-shadow: 10px 10px 0 rgba(0, 168, 150, 0.18);
}

.line-number {
    color: #67757c;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.75rem;
}

.query-line code {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #d5dddf;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.86rem;
}

.query-line code b {
    color: var(--yellow);
}

.query-status {
    grid-column: 2;
    color: #819096;
    font-size: 0.7rem;
}

.query-status i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--teal);
}

.hero-facts {
    position: relative;
    z-index: 2;
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 72px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-facts div {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 24px 20px 0 0;
}

.hero-facts dt {
    color: var(--teal);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 2.2rem;
    font-weight: 800;
}

.hero-facts dd {
    margin: 0;
    color: #aab6ba;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.skill-ribbon {
    display: flex;
    align-items: stretch;
    color: var(--ink);
    background: var(--yellow);
}

.ribbon-label {
    display: grid;
    min-width: 150px;
    place-items: center;
    padding: 15px 20px;
    color: var(--white);
    background: var(--coral);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.skill-ribbon ul {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 12px 24px;
    margin: 0;
    padding: 15px 24px;
    list-style: none;
}

.skill-ribbon li {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 700;
}

.skill-ribbon li::before {
    margin-right: 10px;
    color: var(--coral);
    content: "+";
}

.section {
    padding: 112px clamp(24px, 7vw, 112px);
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(130px, 0.35fr) minmax(300px, 1fr) minmax(260px, 0.65fr);
    align-items: end;
    gap: clamp(24px, 5vw, 72px);
    margin-bottom: 64px;
}

.section-number {
    align-self: start;
    color: var(--teal-dark);
}

h2 {
    margin-bottom: 0;
    font-size: 4.8rem;
    line-height: 0.96;
    letter-spacing: 0;
}

.section-heading > p:last-child {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 1rem;
}

.model-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.model-card {
    position: relative;
    display: flex;
    min-height: 430px;
    flex-direction: column;
    overflow: hidden;
    padding: clamp(24px, 3vw, 40px);
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
}

.model-card::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 7px;
    background: var(--teal);
    content: "";
}

.model-many::before,
.model-poly::before {
    background: var(--coral);
}

.card-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.model-tag {
    order: 2;
    flex: 0 0 auto;
    color: var(--teal-dark);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 800;
}

.model-many .model-tag,
.model-poly .model-tag {
    color: var(--coral);
}

.model-card h3,
.performance-item h3 {
    margin-bottom: 16px;
    font-size: 1.75rem;
    line-height: 1.1;
}

.model-card > p,
.star-copy > p {
    max-width: 560px;
    color: var(--muted);
    font-size: 0.95rem;
}

.diagram {
    position: relative;
    flex: 1;
    margin: 26px 0 24px;
}

.diagram-pair {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(70px, 0.65fr) minmax(110px, 1fr);
    align-items: center;
}

.table-node {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    border: 1px solid var(--ink);
    background: var(--white);
    box-shadow: 5px 5px 0 var(--line);
}

.table-node strong {
    padding: 9px 11px;
    color: var(--white);
    background: var(--ink-soft);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
}

.table-node span {
    display: flex;
    min-height: 35px;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.66rem;
}

.key,
.foreign {
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--yellow);
}

.foreign {
    background: var(--teal);
}

.node-stack {
    box-shadow: 4px 4px 0 var(--white), 5px 5px 0 var(--ink), 9px 9px 0 var(--white), 10px 10px 0 var(--ink);
}

.relation-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 5px;
    color: var(--coral);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.82rem;
}

.relation-line span,
.mini-line {
    height: 1px;
    background: var(--coral);
}

.rule,
.performance-item code {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-top: auto;
    padding: 8px 10px;
    overflow-wrap: anywhere;
    color: var(--teal-dark);
    background: #e7f4ef;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.68rem;
}

.diagram-trio {
    display: grid;
    grid-template-columns: minmax(72px, 0.8fr) minmax(20px, 0.35fr) minmax(96px, 1.15fr) minmax(20px, 0.35fr) minmax(72px, 0.8fr);
    align-items: center;
}

.compact strong {
    padding: 8px;
    text-align: center;
}

.compact span,
.bridge-node span {
    justify-content: center;
    padding: 5px;
    text-align: center;
}

.bridge-node {
    border-color: var(--teal-dark);
    box-shadow: 5px 5px 0 rgba(0, 168, 150, 0.25);
}

.bridge-node strong {
    color: var(--ink);
    background: var(--teal);
    text-align: center;
}

.poly-diagram {
    display: grid;
    grid-template-columns: minmax(70px, 0.7fr) minmax(20px, 0.25fr) minmax(100px, 1fr) minmax(20px, 0.25fr) minmax(82px, 0.8fr);
    align-items: center;
}

.poly-line {
    height: 1px;
    background: var(--coral);
}

.poly-targets {
    display: grid;
    gap: 14px;
}

.model-star {
    min-height: 460px;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(230px, 0.7fr) minmax(460px, 1.3fr);
    align-items: center;
    gap: 64px;
    background: #eef4f1;
}

.model-star::before {
    width: 100px;
    background: var(--yellow);
}

.star-copy {
    display: flex;
    align-self: stretch;
    flex-direction: column;
    justify-content: center;
}

.star-diagram {
    position: relative;
    display: grid;
    min-height: 340px;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    grid-template-rows: repeat(3, minmax(70px, 1fr));
    align-items: center;
    justify-items: center;
}

.star-node {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(120px, 90%);
    min-height: 62px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    background: var(--white);
    box-shadow: 4px 4px 0 var(--line);
}

.star-node small {
    color: var(--coral);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.58rem;
    font-weight: 800;
}

.star-node strong {
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.75rem;
}

.star-node span {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.6rem;
}

.fact-node {
    width: min(140px, 96%);
    min-height: 108px;
    grid-column: 2;
    grid-row: 2;
    color: var(--white);
    background: var(--ink);
    box-shadow: 7px 7px 0 var(--teal);
}

.fact-node small {
    color: var(--yellow);
}

.dim-date { grid-column: 2; grid-row: 1; }
.dim-product { grid-column: 3; grid-row: 2; }
.dim-customer { grid-column: 2; grid-row: 3; }
.dim-store { grid-column: 1; grid-row: 2; }

.star-connector {
    position: absolute;
    z-index: 1;
    width: 1px;
    height: 39%;
    background: var(--coral);
    transform-origin: center;
}

.connector-one { transform: translateY(-35%) rotate(0deg); }
.connector-two { transform: translateX(58%) rotate(90deg); }
.connector-three { transform: translateY(35%) rotate(0deg); }
.connector-four { transform: translateX(-58%) rotate(90deg); }

.performance {
    color: var(--white);
    background: var(--ink-soft);
}

.section-heading-light .section-number {
    color: var(--yellow);
}

.section-heading-light > p:last-child {
    color: #aeb9bd;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.performance-item {
    position: relative;
    min-height: 390px;
    padding: 34px clamp(20px, 3vw, 40px) 28px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.performance-item:last-child {
    border-right: 0;
}

.performance-item::before {
    position: absolute;
    top: -4px;
    left: 0;
    width: 70px;
    height: 7px;
    background: var(--teal);
    content: "";
}

.performance-item.coral::before { background: var(--coral); }
.performance-item.yellow::before { background: var(--yellow); }

.performance-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}

.performance-title > span {
    order: 2;
    color: #7d8b91;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.74rem;
}

.performance-summary {
    min-height: 78px;
    margin-bottom: 20px;
    color: var(--white);
    font-size: 1.08rem;
    font-weight: 700;
}

.performance-item > p:not(.performance-summary) {
    color: #aeb9bd;
    font-size: 0.88rem;
}

.performance-item code {
    margin-top: 32px;
    color: var(--ink);
    background: var(--teal);
}

.performance-item.coral code { background: var(--coral); }
.performance-item.yellow code { background: var(--yellow); }

.profile {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(320px, 1fr) minmax(250px, 0.75fr);
    align-items: center;
    gap: clamp(32px, 6vw, 90px);
    background: var(--white);
}

.profile-mark {
    position: relative;
    display: grid;
    width: min(280px, 100%);
    aspect-ratio: 1;
    place-items: center;
    border: 2px solid var(--ink);
    color: var(--white);
    background: var(--blue);
    box-shadow: 14px 14px 0 var(--yellow);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 5rem;
    font-weight: 800;
}

.profile-mark::before,
.profile-mark::after {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--coral);
    content: "";
}

.profile-mark::before { top: 18px; right: 18px; }
.profile-mark::after { bottom: 18px; left: 18px; border-radius: 50%; }
.profile-mark span { color: var(--yellow); }

.profile-copy .section-number {
    margin-bottom: 18px;
}

.profile-copy h2 {
    margin-bottom: 28px;
    font-size: 4rem;
}

.profile-copy > p:not(.section-number) {
    margin-bottom: 28px;
    color: var(--muted);
}

.button-dark {
    color: var(--white);
    background: var(--ink);
}

.button-dark:hover,
.button-dark:focus-visible {
    color: var(--ink);
    background: var(--yellow);
}

.principles {
    margin: 0;
    border-top: 1px solid var(--line);
}

.principles div {
    padding: 19px 0;
    border-bottom: 1px solid var(--line);
}

.principles dt {
    margin-bottom: 4px;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.principles dd {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px clamp(24px, 7vw, 112px);
    color: #aeb9bd;
    background: var(--ink);
    font-size: 0.75rem;
}

footer p {
    margin: 0;
}

footer a {
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

a:focus-visible {
    outline: 3px solid var(--yellow);
    outline-offset: 4px;
}

@media (max-width: 980px) {
    .site-header {
        grid-template-columns: 1fr auto;
    }

    nav {
        display: none;
    }

    .hero {
        grid-template-columns: 1fr;
        padding-top: 144px;
    }

    h1 {
        font-size: 5.5rem;
    }

    h2 {
        font-size: 4rem;
    }

    .query-line {
        right: 7vw;
        bottom: 166px;
        width: 42vw;
    }

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

    .section-heading > p:last-child {
        grid-column: 2;
    }

    .model-star {
        grid-template-columns: 0.7fr 1.3fr;
        gap: 30px;
    }

    .profile {
        grid-template-columns: minmax(180px, 0.55fr) 1fr;
    }

    .principles {
        grid-column: 2;
    }
}

@media (max-width: 760px) {
    .site-header {
        padding: 18px 20px;
    }

    .wordmark small,
    .contact-link {
        font-size: 0.68rem;
    }

    .hero {
        min-height: 690px;
        min-width: 0;
        padding: 130px 20px 32px;
    }

    .hero-content,
    .query-line,
    .hero-facts {
        min-width: 0;
        max-width: 100%;
    }

    .hero::before {
        top: 30%;
        right: -33%;
        width: 86vw;
    }

    .hero::after {
        top: 39%;
        right: -18%;
        width: 56vw;
    }

    h1 {
        font-size: 3.65rem;
    }

    .hero-copy {
        font-size: 1rem;
    }

    .hero-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .query-line {
        position: relative;
        right: auto;
        bottom: auto;
        grid-column: 1;
        width: 100%;
        margin-top: 42px;
    }

    .hero-facts {
        margin-top: 34px;
    }

    .hero-facts div {
        display: block;
        padding-top: 16px;
    }

    .hero-facts dt {
        font-size: 1.5rem;
    }

    .hero-facts dd {
        max-width: 90px;
        font-size: 0.6rem;
    }

    .skill-ribbon {
        display: block;
    }

    .ribbon-label {
        min-height: 40px;
    }

    .skill-ribbon ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        padding: 18px 20px;
    }

    .section {
        padding: 78px 20px;
    }

    .section-heading {
        display: block;
        margin-bottom: 40px;
    }

    .section-heading h2 {
        margin-bottom: 22px;
        font-size: 3rem;
    }

    .model-grid,
    .performance-grid,
    .profile {
        grid-template-columns: 1fr;
    }

    .model-card {
        min-height: 400px;
        padding: 24px 20px;
    }

    .model-star {
        display: block;
    }

    .star-copy {
        min-height: 250px;
    }

    .star-diagram {
        min-height: 330px;
    }

    .performance-item {
        min-height: 0;
        padding: 34px 0 38px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    }

    .performance-item:last-child {
        border-bottom: 0;
    }

    .performance-summary {
        min-height: 0;
    }

    .profile {
        gap: 54px;
    }

    .profile-mark {
        width: min(260px, calc(100% - 16px));
        font-size: 4.4rem;
    }

    .profile-copy h2 {
        font-size: 3rem;
    }

    .principles {
        grid-column: 1;
    }

    footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .contact-link {
        max-width: 76px;
        text-align: right;
    }

    h1 {
        font-size: 3.2rem;
    }

    .diagram-pair {
        grid-template-columns: minmax(88px, 1fr) minmax(48px, 0.45fr) minmax(88px, 1fr);
    }

    .diagram-trio,
    .poly-diagram {
        margin-right: -9px;
        margin-left: -9px;
    }

    .table-node strong {
        font-size: 0.66rem;
    }

    .table-node span {
        font-size: 0.58rem;
    }

    .rule {
        font-size: 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
