/*
 * PHP USERGROUP DRESDEN – "Elbe of Code".
 * PHP indigo and lilac, the club's orange for actions, one typeface (Recursive) used as sans and as mono.
 * No framework, no external resources: the font is self-hosted (SIL OFL, see /fonts/Recursive-OFL.txt).
 */

@font-face {
    font-family: "Recursive";
    src: url("/fonts/recursive-latin.woff2") format("woff2");
    font-weight: 300 1000;
    font-style: oblique 0deg 15deg;
    font-display: swap;
}

:root {
    --paper: #f7f7fb;
    --surface: #ffffff;
    --surface-alt: #eeeff7;
    --ink: #1e2140;
    --muted: #555a7a;
    --line: #dcddeb;
    --php: #4f5b93;
    --php-light: #777bb3;
    --lilac: #e9eaf5;
    --orange: #ee7203;
    --on-orange: #1e2140;
    --link: #4f5b93;
    --focus: #ee7203;

    --hero-bg: #1e2140;
    --hero-text: #f2f2fa;
    --hero-muted: #b9bcdb;
    --label: var(--php);
    --badge-ink: var(--php);

    --font: "Recursive", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Recursive", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --radius: 6px;
    --container: 72rem;
    color-scheme: light dark;
}

/* Dark tokens: follow the system unless the visitor picked a theme with the header toggle (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #15172c;
        --surface: #1d2040;
        --surface-alt: #191b35;
        --ink: #ecedf7;
        --muted: #b4b7d6;
        --line: #2e3260;
        --php-light: #8d92cc;
        --lilac: #2a2e5a;
        --orange: #ff8a1f;
        --on-orange: #15172c;
        --link: #aeb3ea;
        --focus: #ff8a1f;
        --hero-bg: #232750;
        --label: var(--link);
        --badge-ink: var(--ink);
    }
}

:root[data-theme="dark"] {
    --paper: #15172c;
    --surface: #1d2040;
    --surface-alt: #191b35;
    --ink: #ecedf7;
    --muted: #b4b7d6;
    --line: #2e3260;
    --php-light: #8d92cc;
    --lilac: #2a2e5a;
    --orange: #ff8a1f;
    --on-orange: #15172c;
    --link: #aeb3ea;
    --focus: #ff8a1f;
    --hero-bg: #232750;
    --label: var(--link);
    --badge-ink: var(--ink);
    color-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    font-variation-settings: "CASL" 0, "MONO" 0;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link);
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-thickness: 2px;
}

/* External links open in a new window (set by the build); announce it visually and to screen readers. */
a[target="_blank"]::after {
    content: "\00a0↗" / " (öffnet in neuem Fenster)";
    text-decoration: none;
    display: inline-block;
}

.logo-grid a[target="_blank"]::after,
.sponsor__logo[target="_blank"]::after {
    content: none;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Headings use Recursive's mono axis: the page speaks code, body text stays in the more readable sans. */
h1,
h2,
h3,
h4,
h5 {
    margin: 2rem 0 0.75rem;
    line-height: 1.15;
    font-variation-settings: "MONO" 1, "CASL" 0;
}

h1 {
    font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-top: 0;
}

h2 {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
    font-weight: 760;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.3rem;
    font-weight: 700;
}

h4,
h5 {
    font-size: 1.1rem;
    font-weight: 680;
}

code,
pre {
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0;
    font-size: 0.92em;
}

/* Times, dates and tags are data: monospaced with aligned digits. */
.program__time,
.event__date,
.recent-list__date,
.year-nav a,
.tag,
.hero__date {
    font-variation-settings: "MONO" 1, "CASL" 0;
    font-variant-numeric: tabular-nums;
}

pre {
    overflow-x: auto;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--hero-bg);
    color: var(--hero-text);
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2.5rem 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--line);
}

blockquote {
    margin: 1.5rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--php-light);
    color: var(--muted);
}

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-radius: var(--radius);
}

.skip-link:focus {
    top: 1rem;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.9rem;
}

.lead {
    font-size: 1.2rem;
    max-width: 40rem;
}

.plain-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plain-list li + li {
    margin-top: 0.35rem;
}

/* Buttons: orange is reserved for actions. */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.55rem 1.2rem;
    border: 2px solid var(--php-light);
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 680;
    text-decoration: none;
    cursor: pointer;
}

.button--primary {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--on-orange);
}

.button:hover {
    text-decoration: underline;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.5rem;
    padding-block: 0.7rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

/* The logo has dark lettering, so it always sits on white – also in dark mode. */
.brand img {
    width: 48px;
    height: 48px;
    padding: 4px;
    border-radius: var(--radius);
    background: #ffffff;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

/* Without JavaScript the button cannot work, so the inline script in the layout reveals it. */
.theme-toggle[hidden] {
    display: none;
}

.theme-toggle:hover {
    border-color: var(--php-light);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

/* Shows the theme the button switches to. */
.theme-toggle__light,
:root[data-theme="dark"] .theme-toggle__dark {
    display: none;
}

:root[data-theme="dark"] .theme-toggle__light {
    display: block;
}

.main-nav {
    order: 3;
    flex-basis: 100%;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    display: inline-block;
    padding: 0.4rem 0;
    color: var(--ink);
    font-weight: 560;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
    border-bottom-color: var(--orange);
}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

@media (min-width: 60rem) {
    .main-nav {
        order: 0;
        flex-basis: auto;
        margin-left: auto;
    }

    .site-header__actions {
        margin-left: 0;
    }
}

/* Hero: the one loud element. Indigo band with PHP code meandering through it like the Elbe. */

.hero {
    position: relative;
    overflow: hidden;
    /* Top and bottom padding reserve the fixed-height code and flow bands, so they never overlap the content. */
    padding-block: 7rem 8.5rem;
    /* Dot grid like graph paper or an editor canvas. */
    background:
        radial-gradient(circle, rgb(119 123 179 / 22%) 1px, transparent 1.5px) 0 0 / 24px 24px,
        var(--hero-bg);
    color: var(--hero-text);
    isolation: isolate;
}

.hero a:not(.button) {
    color: var(--hero-text);
}

.hero .lead,
.hero .muted {
    color: var(--hero-muted);
}

.hero__band {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 100%;
    overflow: hidden;
}

.hero__band--code {
    top: 0.5rem;
    height: 90px;
}

.hero__band--flow {
    bottom: 1rem;
    height: 100px;
}

.hero__code {
    fill: var(--php-light);
    opacity: 0.45;
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1, "CASL" 0;
    font-size: 22px;
}

/* Syntax colours of the decorative code line. */
.hero__code .tok-kw {
    fill: #ee7203;
}

.hero__code .tok-var {
    fill: #b9bcdb;
}

.hero__code .tok-str {
    fill: #9fd4a3;
}

.hero__flow {
    fill: none;
    stroke: var(--php-light);
    stroke-linecap: round;
    stroke-width: 3;
    /* Dash pattern reads like tokens on a line of code. */
    stroke-dasharray: 34 12 8 12 56 12 16 12;
    opacity: 0.35;
}

.hero__flow--2 {
    stroke: #ee7203;
    opacity: 0.4;
    stroke-dasharray: 12 14 40 14 6 14 22 14;
}

.hero__flow--3 {
    opacity: 0.2;
}

.hero__inner {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 60rem) {
    .hero__inner {
        grid-template-columns: 1.5fr 1fr;
        gap: 4rem;
    }
}

.hero h1 {
    max-width: 15ch;
}

.hero__next {
    padding: 1.5rem 1.6rem 1.75rem;
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius);
    border-left: 6px solid var(--orange);
}

.hero__next a:not(.button) {
    color: var(--ink);
}

.hero__next .muted {
    color: var(--muted);
}

.hero__label {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--label);
    letter-spacing: 0;
}

.hero__date {
    margin: 0;
    font-weight: 620;
}

.hero__title {
    margin: 0.25rem 0 0.5rem;
    font-size: 1.45rem;
    font-weight: 780;
    line-height: 1.25;
    font-variation-settings: "MONO" 1, "CASL" 0;
}

.hero__talks {
    margin: 1rem 0 1.25rem;
}

/* Motion is opt-in: the river only flows when the visitor has not asked for reduced motion. */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }

    .hero__flow {
        animation: elbe-flow 40s linear infinite;
    }

    .hero__flow--2 {
        animation-name: elbe-flow-alt;
        animation-duration: 55s;
    }

    .hero__flow--3 {
        animation-duration: 70s;
    }

    .button,
    .main-nav a {
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
}

/* Offsets are 8× the dash pattern length (162 resp. 136), so the loop restarts without a jump. */
@keyframes elbe-flow {
    to {
        stroke-dashoffset: -1296;
    }
}

@keyframes elbe-flow-alt {
    to {
        stroke-dashoffset: -1088;
    }
}

/* Sections */

.section {
    padding-block: clamp(3rem, 6vw, 4.5rem);
}

.section--alt {
    background: var(--surface-alt);
}

.section h2 {
    margin-top: 0;
}

.section__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 1.25rem;
}

.page {
    padding-block: clamp(2.5rem, 6vw, 4rem) 4rem;
}

.prose {
    max-width: 44rem;
}

.prose > :first-child {
    margin-top: 0;
}

/* Recent events: a quiet list, not a card grid. */

.recent-list,
.team-grid,
.logo-grid,
.sponsor-list,
.talk-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-list__item {
    display: grid;
    gap: 0.25rem 2rem;
    padding-block: 1.25rem;
    border-top: 1px solid var(--line);
}

.recent-list__item:last-child {
    border-bottom: 1px solid var(--line);
}

@media (min-width: 48rem) {
    .recent-list__item {
        grid-template-columns: 11rem 1fr;
    }

    .recent-list__talks {
        grid-column: 2;
    }
}

.recent-list__date {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.recent-list__title {
    margin: 0;
    font-size: 1.15rem;
}

.recent-list__title a {
    color: var(--ink);
}

.recent-list__talks {
    color: var(--muted);
}

/* Team */

.team-grid {
    display: grid;
    /* 8.75rem lets six members plus the "Du?" card share one row at full container width. */
    grid-template-columns: repeat(auto-fill, minmax(8.75rem, 1fr));
    gap: 1.75rem 1rem;
    text-align: center;
}

.member img,
.member__placeholder {
    display: grid;
    place-items: center;
    width: 8rem;
    height: 8rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    object-fit: cover;
}

.member img {
    box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--php-light);
}

.member__placeholder {
    background: var(--lilac);
    color: var(--label);
    border: 2px dashed var(--php-light);
    font-family: var(--font-mono);
    font-variation-settings: "MONO" 1;
    font-size: 1.6rem;
    font-weight: 700;
}

.member__name {
    margin: 0;
    font-weight: 700;
}

.member__role {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Logos */

.logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
    gap: 1rem;
}

.logo-grid a,
.sponsor__logo {
    display: block;
    min-width: 0;
    height: 7.5rem;
    padding: 1rem;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

/* Fixed box + contain: logos of any aspect ratio scale down without overflowing their tile. */
.logo-grid img,
.sponsor__logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sponsor {
    display: grid;
    gap: 1rem 2rem;
    padding-block: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.sponsor h3 {
    margin-top: 0;
}

.sponsor__logo {
    height: 9rem;
}

@media (min-width: 48rem) {
    .sponsor {
        grid-template-columns: 16rem 1fr;
        align-items: center;
    }
}

/* Events */

.event {
    margin-block: 1.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-margin-top: 7rem;
}

.event--upcoming {
    border-left: 6px solid var(--orange);
}

.event__header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem 1.25rem;
    align-items: start;
}

.event__cta {
    grid-column: 1 / -1;
    justify-self: start;
}

@media (min-width: 48rem) {
    .event__header {
        grid-template-columns: auto 1fr auto;
    }

    .event__cta {
        grid-column: auto;
    }
}

.event__date {
    display: grid;
    place-items: center;
    min-width: 4.5rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--lilac);
    color: var(--badge-ink);
    line-height: 1.1;
}

.event__day {
    font-size: 1.7rem;
    font-weight: 850;
}

.event__month {
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.event__title {
    margin: 0;
    font-size: 1.3rem;
}

.event__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.event__image {
    display: block;
    margin-top: 1.25rem;
    border-radius: var(--radius);
    max-height: 22rem;
    width: 100%;
    object-fit: cover;
}

.event .prose {
    margin-top: 1rem;
}

.program {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.program__item {
    display: grid;
    grid-template-columns: 3.5rem 1fr;
    gap: 1rem;
    padding-block: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.program__time {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.talk__title {
    margin: 0;
    font-size: 1.1rem;
}

.talk__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    margin: 0.3rem 0 0;
}

.talk__speaker {
    font-weight: 620;
}

.tag {
    display: inline-block;
    padding: 0.05rem 0.6rem;
    border-radius: 3px;
    background: var(--lilac);
    color: var(--badge-ink);
    font-size: 0.8rem;
    font-weight: 650;
}

.tag--quiet {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
}

details {
    margin-top: 0.5rem;
}

summary {
    cursor: pointer;
    color: var(--link);
    font-weight: 620;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.year-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.year-nav a {
    display: inline-block;
    min-width: 44px;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    text-align: center;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.year-heading {
    scroll-margin-top: 7rem;
    margin-top: 3rem;
    font-size: 1.6rem;
}

.talk-list__item {
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
}

.talk-list__item p {
    margin: 0.3rem 0 0;
}

/* Footer */

.site-footer {
    margin-top: 2rem;
    padding-top: 3rem;
    background: var(--surface-alt);
    border-top: 1px solid var(--line);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 2rem;
}

.site-footer__title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.site-footer__bottom {
    padding-block: 2rem;
    color: var(--muted);
}

.newsletter label {
    display: block;
    margin-bottom: 0.35rem;
}

.newsletter__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.newsletter input {
    flex: 1 1 12rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--muted);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
}

@media (forced-colors: active) {
    .button,
    .tag,
    .event__date {
        border: 1px solid CanvasText;
    }

    .hero__band {
        display: none;
    }
}
