:root {
    --bg-color: #ffffff;
    --text-color: #0d0e10;
    /* hues #2f00ff and #ff3200 */
    --muted: #475569;
    --accent: #cad0eb;
    --keyidea: #a54b1e;
    --border: #e2e8f0;
    --card: #cad0eb;
    --radius: 16px;
    --shadow: 0 10px 25px rgba(0, 0, 0, .06);

    --ratio: 1.25;
    --step-0: 1rem;
    --step-1: calc(var(--step-0) * var(--ratio));
    --step-2: calc(var(--step-1) * var(--ratio));
    --step-3: calc(var(--step-2) * var(--ratio));
    --step-4: calc(var(--step-3) * var(--ratio));
    --step-5: calc(var(--step-4) * var(--ratio));
    --step-6: calc(var(--step-5) * var(--ratio));
    --step-7: calc(var(--step-6) * var(--ratio));
    --step-8: calc(var(--step-7) * var(--ratio));
    --step-9: calc(var(--step-8) * var(--ratio));
    --step-10: calc(var(--step-9) * var(--ratio));
    --step-11: calc(var(--step-10) * var(--ratio));
    --step-12: calc(var(--step-11) * var(--ratio));
    --step-13: calc(var(--step-12) * var(--ratio));
    --step-14: calc(var(--step-13) * var(--ratio));
    --step-15: calc(var(--step-14) * var(--ratio));
    --step-16: calc(var(--step-15) * var(--ratio));
    --step-17: calc(var(--step-16) * var(--ratio));
    --step--1: calc(var(--step-0) / var(--ratio));
    --step--2: calc(var(--step--1) / var(--ratio));
    --step--3: calc(var(--step--2) / var(--ratio));
    --step--4: calc(var(--step--3) / var(--ratio));
    --step--5: calc(var(--step--4) / var(--ratio));
    --step--6: calc(var(--step--5) / var(--ratio));
}

body.dark {
  --bg-color: #111111;
  --text-color: #f1f1f1;
  --accent-color: #007bd3;
  --nav-bg: #1a1a1a;
  --card-bg: #222222;
}

body.sumner {
  --bg-color: #ffffff;
  --text-color: #0d0e10;
  --neutral: #616575;
  --greenlight: #96F53E;
  --redlight: #F57751;
  --breakout: #ae9eff60;
  --callouts: #cdc8e6;
  --structin: #7aaac9;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Segoe UI, Roboto, Verdana, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: 12px;
    /* transition: background-color 0.3s, color 0.3s; */
}

a {
    color: #000;
    text-decoration: none;
}

a.standout {
    color: var(--keyidea);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

a.standout:hover {
    opacity: 0.75;
}

header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

.brand {
    font-weight: 700;
    letter-spacing: .2px;
}

article, main {
    padding: 0;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.hero {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 4rem var(--step-4);
    margin-bottom: var(--step-4);
    background: var(--callouts);
}

.hero h1 {
    flex: 1;
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.1;
}

.hero p {
    flex: 1;
    margin: 0;
    font-size: 1.2rem;
}

.material {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: var(--step-6);
}

.card {
    background: var(--structin);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
    height: 100%;
}

section {
    padding: 0 1.5rem;
}

article > section {
    padding: 0 var(--step-1);
    margin-bottom: var(--step-6);
    width: unset;
}

article > section > h2 {
    margin-top: 0;
    /* padding-top: var(--step-7); */
    
}

h2, h3, .insight.block {
    scroll-margin-top: var(--step-7);
}

article .numbering {
    margin-right: 0.5ch;
}

.article-info {
    display: flex;
    flex-direction: row;
    padding: 0 var(--step-1);
    width: 100%;
    margin-bottom: var(--step-4);
}

.article-info > .index {
    font-size: var(--step--1);
}

.article-info > .index ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--step--5);
}

.article-info > .index a {
    color: var(--muted);
    text-decoration: none;
}

.article-info > .index a:hover {
    color: var(--muted);
    text-decoration: none;
}

.article-info > .versions {
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: var(--step-0);
    row-gap: 0;
    justify-content: end;
    font-size: var(--step-0);
    height: fit-content;
    padding: 0;
    margin:0;
    margin-left: auto;
}

.article-info > .versions > label {
    justify-self: end;
    font-weight: 500;
}

.article-info > .versions > select {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background-color: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
}

div.block {
    border: 1px solid var(--border);
    padding: var(--step-4);
}

.warning {
    background: #ff6f0086;
    margin-bottom: var(--step--4);
}

.warning>h4 {
    margin: 0;
}

.warning>p {
    margin: 0;
}

.insight {
    background: var(--breakout);
    margin-bottom: var(--step--4);
}

.insight>h3 {
    margin: 0;
}

.insight>p {
    margin: 0;
}

.interactions input {
    margin-left: var(--step-1);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

/* Hide default number spinners */
.interactions input[type=number]::-webkit-outer-spin-button,
.interactions input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.interactions input[type=number] {
  -moz-appearance: textfield;
}

.number-input-wrapper {
    display: inline-flex;
    align-items: center;
    position: relative;
    vertical-align: middle;
}

.number-controls {
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 5px;
    height: calc(100% - 4px);
    justify-content: center;
    gap: 1px;
}

.number-controls button {
    background: #eee;
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 8px;
    padding: 0 5px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 45%;
    border-radius: 3px;
    color: var(--text-color);
}

.number-controls button:hover {
    background: #ddd;
}

.interactions span {
    margin-left: var(--step-1);
    /* border: 1px solid var(--border); */
    /* border-radius: 10px; */
    font: inherit;
    background: #fff;
}

.figure-numbering {
    display: flex;
    justify-content: center;
}

.figure-numbering p {
    font-size: var(--step-0);
    margin:0;
    margin-bottom: var(--step-1);
    width:60%;
    text-align: center;
}

p.mod-seq {
    margin-bottom: var(--step--2);
}

div.mod-seq {
    word-break: normal;
    font-family: monospace;
    height: var(--step-8);
    font-size: var(--step--1);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: var(--step-1);
    background: #fff;
    margin-bottom: var(--step-2);
}

.charta svg {
    display: block;
    width: 100%;
    height: auto;
}
.charta .axis-label {
    fill: #333;
}
.charta .legend-item {
    cursor: pointer;
}
.charta .legend-item text {
    user-select: none;
}
.gamman.tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #bbb;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    color: #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    display: none;
    white-space: nowrap;
}

footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: var(--step-0);
}

footer > div {
    max-width: var(--step-15);
    margin-inline: auto;
    padding: var(--step-3) var(--step-2);
}

.social-links {
    display: flex;
    gap: 16px;
}

.social-links a {
    color: var(--muted);
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--accent);
}

@media (min-width: 600px) {
    body {
        font-size: 16px;
    }
    .material {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    article > section {
        width: unset;
    }
    .hero {
        padding: 4rem var(--step-5);
    }
}

@media (min-width: 768px) {
    .hero {
        flex-direction: row;
        align-items: flex-start;
        padding: 4rem var(--step-6);
    }
}

@media (min-width: 900px) {
    body {
        font-size: 18px;
    }
    .material {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    article > section, main>section.content, .article-info {
        width: var(--step-17);
    }
    .hero {
        padding: 4rem var(--step-8);
    }
}

/* ── Card pills ──────────────────────────────────────────────── */
.pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 999px;
    margin-top: var(--step-0);
}
.pill--app     { background: #2a6bcc; color: #fff; }
.pill--code    { background: #2a7a48; color: #fff; }
.pill--article { background: #6a3a9a; color: #fff; }

/* ── Time theme (landing page only) ──────────────────────────── */
body.time-theme {
    --callouts: #f4edde;   /* pale warm cream — hero */
    --structin: #c8b08a;   /* muted sandy tan — cards */
    --bg-color: #fdf9f3;
}

.time-theme .card {
    border-color: #d4a81a;  /* bright goldenrod edge */
}

.hero { position: relative; }

#geo-info {
    position: absolute;
    z-index: 1;
    bottom: 0.75rem;
    left: var(--step-4);
    margin: 0;
    font-size: var(--step--3);
    color: var(--muted);
    opacity: 0.75;
    line-height: 1;
    letter-spacing: 0.2px;
}
@media (min-width: 600px) { #geo-info { left: var(--step-5); } }
@media (min-width: 768px) { #geo-info { left: var(--step-6); } }
@media (min-width: 900px) { #geo-info { left: var(--step-8); } }

#time-widget {
    position: absolute;
    z-index: 1;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 90px;
    pointer-events: none;
}
#time-widget svg { width: 90px; height: 90px; }
#time-widget .tw-label {
    font-size: 9px;
    text-align: center;
    color: var(--muted);
    line-height: 1.3;
    white-space: pre-line;
}
@media (max-width: 600px) {
    #time-widget { width: 65px; top: 1rem; right: 1rem; }
    #time-widget svg { width: 65px; height: 65px; }
}

#solar-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: visible;
}

.time-theme .hero > h1,
.time-theme .hero > p {
    position: relative;
    z-index: 1;
}