/* Layout and content of the demo page. Colours come from the theme: the --as-… tokens in
   glass.css, which also set the --sap… variables UI5 Web Components read. */

:root {
	--fg: var(--sapTextColor, #131e29);
	--muted: var(--sapContent_LabelColor, #556b82);
	--line: var(--sapGroup_TitleBorderColor, rgba(85, 107, 130, .2));
	--link: var(--as-accent-text);
	--font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	--header-h: 3.5rem;
	--width: 80rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	color-scheme: light dark;
}
html[data-theme$="dark"], html[data-theme="sap_horizon_hcb"] { --fg: #eaecee; --muted: #a9b4be; --line: rgba(255, 255, 255, .12); }

html { scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; color: var(--fg); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--as-accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; z-index: 30; }
.skip:focus { left: 1rem; top: .5rem; background: var(--as-glass-strong); padding: .5rem 1rem; }
h1 { text-wrap: balance; }

/* ---------- header: one sticky glass bar ---------- */
.site-header { position: sticky; top: 0; z-index: 20; height: var(--header-h); }
.site-bar {
	display: flex; align-items: center; gap: .5rem; height: 100%; box-sizing: border-box;
	max-width: calc(var(--width) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
}
.site-bar a { text-decoration: none; color: var(--fg); font-size: .875rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1rem !important; min-width: 0; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-nav { display: flex; gap: .25rem; margin-left: auto; }
.top-nav a { padding: .375rem .75rem; border-radius: 999px; font-weight: 600; line-height: 1.375rem; transition: background-color .15s; }
.top-nav a:hover { background: color-mix(in srgb, var(--as-accent) 10%, transparent); }
@media (max-width: 40rem) { .top-nav { display: none; } }

/* ---------- content ---------- */
.page { max-width: var(--width); margin: 0 auto; padding: 0 var(--gutter); }
main { display: block; padding-block: 1rem 4rem; }
.prose p, .prose li { max-width: 46rem; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -.015em; margin: 3rem 0 1rem; }
.prose code { font-family: var(--mono); font-size: .875em; background: var(--as-glass); border: 1px solid var(--as-glass-edge); border-radius: .375rem; padding: .05rem .3rem; }
.prose pre { max-width: 46rem; background: var(--as-glass-strong); border: 1px solid var(--as-glass-edge); border-radius: var(--as-radius-control); padding: 1rem 1.25rem; overflow-x: auto; line-height: 1.5; }
.prose pre code { border: 0; padding: 0; background: none; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.55; color: var(--muted); }
.kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--as-accent-text); margin: 0 0 .5rem; }

.hero { padding: clamp(1.5rem, 4vw, 3.5rem) 0 1rem; }
.hero h1 { font-size: clamp(2.25rem, 5vw, 3.4rem); line-height: 1.07; letter-spacing: -.03em; margin: 0 0 1.25rem; max-width: 20ch; }
.hero .lead { max-width: 44rem; margin: 0; }

/* ---------- buttons, the same shape as the UI5 ones ---------- */
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }
.button {
	display: inline-flex; align-items: center; height: 2.25rem; padding: 0 1rem; border-radius: 999px; box-sizing: border-box;
	border: 0; color: var(--as-accent-text) !important; background: var(--as-tint);
	text-decoration: none !important; font-weight: 700; font-size: .875rem; white-space: nowrap;
}
.button:hover { background: var(--as-tint-strong); }
.button.primary { background: var(--as-accent); color: #fff !important; }
.button.primary:hover { background: var(--as-accent-hover); }

/* ---------- the three packages ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1.25rem; margin: 1rem 0 0; }
.card { position: relative; border-radius: var(--as-radius); padding: 1.25rem 1.25rem 1.1rem; display: flex; flex-direction: column; }
.card h3 { margin: .25rem 0 .5rem; font-size: 1.0625rem; line-height: 1.35; font-family: var(--mono); }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card p { margin: 0 0 .5rem; font-size: .9375rem; }
.card .meta { color: var(--muted); font-size: .8125rem; margin: 0; }

/* ---------- the sandbox: room reserved before it loads, so nothing moves ---------- */
.sandbox { min-height: 40rem; margin: 1.5rem 0 2.5rem; padding: 1rem; border-radius: var(--as-radius);
	--sbx-line: var(--line); --sbx-muted: var(--muted); --sbx-font: var(--font); --sbx-mono: var(--mono);
	--sbx-surface: var(--as-glass-strong); --sbx-tint: var(--as-tint); --sbx-tint-strong: var(--as-tint-strong);
	--sbx-accent-text: var(--as-accent-text); --sbx-radius: var(--as-radius-control); --sbx-ease: var(--as-ease); }
@media (max-width: 60rem) { .sandbox { min-height: 65rem; } }
.sandbox-fallback { margin: 0; padding: 2rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; font-size: .875rem; color: var(--muted); }
.site-footer p { margin: .25rem 0; max-width: 46rem; }
.fineprint { font-size: .75rem; margin-top: 1rem !important; }
