:root {
    color-scheme: light;

    --bg: #f5f1ea;
    --surface: #fcfaf7;
    --surface-alt: #ece5dc;
    --text: #1f1c17;
    --muted: #6f675e;
    --border: #d7cfc4;
    --primary: #0e6b68;
    --primary-dark: #0a4f4d;

    --max: 1180px;
    --narrow: 780px;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(31, 28, 23, 0.08);
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #161513;
    --surface: #1f1d1a;
    --surface-alt: #2a2622;
    --text: #f3efe8;
    --muted: #b5ab9f;
    --border: #3c3832;
    --primary: #58a6a3;
    --primary-dark: #3d8481;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

/*
     TEST */
html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}
/*
     TEST */

a {
    color: inherit;
    text-decoration: none;
}

p > code,
li > code {
    display: inline-block;
    padding: 0.12rem 0.35rem;
    border-radius: 0.3rem;
    background-color: rgba(0, 0, 0, 0.04);
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.95em;
    white-space: nowrap;
}

#main article.blog-article {
    max-width: 58rem;
    margin-inline: auto;
}

.blog-article .back-link,
#main article .back-link,
#main article p:last-child {
    margin-top: 2.5rem;
}

@media (min-width: 1280px) {
    #main article.blog-article {
        max-width: 62rem;
    }
}

#main article.blog-article p.lead {
    max-width: none;
    overflow: visible;
    white-space: normal;
    line-height: 1.7;
}

#main article li > p,
#main article li > div,
#main article li > span {
    margin: 0;
    padding: 0;
}

#main article li > p::before,
#main article li > div::before,
#main article li > span::before,
#main article li > p::after,
#main article li > div::after,
#main article li > span::after {
    content: none !important;
    display: none !important;
}

#main article ul,
#main article ol {
    margin: 1rem 0 1.25rem 1.5rem;
    padding: 0;
    list-style-position: outside;
}

#main article ul {
    list-style: disc outside !important;
}

#main article ul ul {
    list-style: circle outside !important;
}

#main article ol {
    list-style: decimal outside !important;
}

#main article li {
    display: list-item !important;
    margin: 0.4rem 0;
    padding: 0 !important;
}

#main article li > *:first-child {
    margin-top: 0;
}

#main article li > *:last-child {
    margin-bottom: 0;
}

#main article li::before,
#main article li::after,
#main article li > *::before,
#main article li > *::after {
    content: none !important;
}

img { max-width: 100%; }

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: var(--surface);
    color: var(--text);
    padding: .75rem 1rem;
    z-index: 1000;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.container {
    width: min(var(--max), calc(100% - 2rem));
    margin: 0 auto;
}

.narrow {
    width: min(var(--narrow), calc(100% - 2rem));
}

.section {
    padding: 4.5rem 0;
}

.section-alt {
    background: var(--surface-alt);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 78px;
}

.brand {
    font-weight: 700;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu a[aria-current="page"] {
    color: var(--primary);
    font-weight: 700;
}

.has-submenu {
    position: relative;
}

.submenu-trigger-wrap {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.submenu-link {
    font-weight: 500;
}

.submenu-toggle {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    padding: .35rem .55rem;
    line-height: 1;
    cursor: pointer;
}

.submenu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 250px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .75rem 0;
    box-shadow: var(--shadow);
    display: none;
}

.submenu li a {
    display: block;
    padding: .6rem 1rem;
}

.submenu li a:hover,
.submenu li a:focus {
    background: var(--surface-alt);
}

.submenu.is-open {
    display: block;
}

.has-submenu.is-active > .submenu-trigger-wrap > .submenu-link {
    color: var(--primary);
    font-weight: 700;
}

.hero-grid,
.contact-box,
.section-head {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    align-items: start;
}

h1, h2, h3 {
    line-height: 1.15;
}

.hero h1 {
    font-size: clamp(2.4rem, 4vw, 4.6rem);
    max-width: 12ch;
}

.lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 62ch;
}

.eyebrow,
.meta {
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--primary);
    font-size: .85rem;
    font-weight: 700;
}

.hero-card,
.card,
.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-card,
.card {
    padding: 1.5rem;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0.5rem 0 0.75rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.card-publisher {
    line-height: 1.4;
}

.article {
    padding: 2rem;
}

.cards {
    display: grid;
    gap: 1.5rem;
}

.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
}

.tag-list span {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: .75rem 1rem;
    border-radius: 999px;
}

.btn {
    display: inline-block;
    padding: .9rem 1.2rem;
    border-radius: 12px;
    font-weight: 700;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-alt);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.text-link {
    color: var(--primary);
    font-weight: 700;
}

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Theme toggle */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-width: 44px;
    min-height: 44px;
    padding: .55rem .85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus {
    background: var(--surface-alt);
    transform: translateY(-1px);
}

.theme-toggle__icon--moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle__icon--sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle__icon--moon {
    display: inline;
}

@media (min-width: 901px) {
    .submenu-toggle {
        display: none;
    }

    .has-submenu:hover .submenu,
    .has-submenu:focus-within .submenu {
        display: block;
    }
}

@media (max-width: 900px) {
    .hero-grid,
    .contact-box,
    .section-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .three-col {
        grid-template-columns: 1fr;
    }

    .nav-toggle {
        display: inline-block;
        border: 1px solid var(--border);
        padding: .7rem 1rem;
        border-radius: 10px;
        background: var(--surface);
        color: var(--text);
        cursor: pointer;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 78px;
        left: 1rem;
        right: 1rem;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        box-shadow: var(--shadow);
    }

    .nav-menu.is-open {
        display: flex;
    }

    .submenu {
        position: static;
        display: none;
        box-shadow: none;
        border: 0;
        padding: .5rem 0 0 1rem;
        min-width: 0;
    }

    .submenu.is-open {
        display: block;
    }
}

@media (min-width: 901px) {
    .nav-toggle {
        display: none;
    }
}