/* ==========================================================================
   Digiup — a Ghost theme based on digiup.io
   "The proof surface": butter-cream / graphite grounds, one cobalt signal,
   pixel-grid display type, square corners, flat borders-first surfaces.
   ========================================================================== */


/* Fonts
   -------------------------------------------------------------------------- */

@font-face {
    font-family: "Geist Pixel Circle";
    src: url("../fonts/GeistPixel-Circle.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}


/* Tokens
   -------------------------------------------------------------------------- */

:root {
    /* Light: butter cream ground, ink black, cobalt signal */
    --background: #fff6e0;
    --foreground: #000000;
    --card: #fff6e0;
    --popover: #fff6e0;
    --popover-foreground: #0a0a0a;
    --primary: var(--ghost-accent-color, #2563eb);
    --primary-foreground: #fff6e0;
    --secondary: #b5b7b5;
    --muted: #f2e9d2;
    --muted-foreground: #8a8a85;
    --border: #e5e7eb;
    --ring: var(--primary);
    --destructive: #e7000b;

    /* Ghost's custom font picker (Admin → Design) overrides the defaults */
    --font-heading: var(--gh-font-heading, "Geist Pixel Circle", ui-monospace, SFMono-Regular, Menlo, monospace);
    --font-body: var(--gh-font-body, "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif);

    --radius: 0;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    --container: 80rem;
    --container-narrow: 48rem;
    --gutter: clamp(1rem, 4vw, 1.5rem);
}

html.dark {
    /* Dark (default on digiup.io): graphite canvas, cream ink, same cobalt */
    --background: #363636;
    --foreground: #fff6e0;
    --card: #363636;
    --popover: #5c5955;
    --popover-foreground: #fff6e0;
    --primary-foreground: #fff6e0;
    --secondary: #808686;
    --muted: #434240;
    --muted-foreground: #b5b7b5;
    --border: #535353;
}

html.dark {
    color-scheme: dark;
}


/* Base
   -------------------------------------------------------------------------- */

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

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.65;
    font-feature-settings: "ss01", "ss02";
    color: var(--foreground);
    background-color: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 0;
    text-wrap: balance;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

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

::selection {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
}


/* Utilities
   -------------------------------------------------------------------------- */

.editorial-caps {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.gh-kicker {
    color: var(--primary);
    letter-spacing: 0.16em;
}

.gh-container {
    max-width: var(--container);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

/* Heavy editorial frame used on cover images (border-8 border-border) */
.gh-frame {
    border: 8px solid var(--border);
    background-color: var(--card);
    overflow: hidden;
    box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.35);
}

html.dark .gh-frame {
    box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.65);
}

.gh-frame img {
    width: 100%;
}


/* Buttons — square, flat, cobalt primary
   -------------------------------------------------------------------------- */

.gh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.gh-btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.gh-btn-primary:hover {
    filter: brightness(1.08);
}

.gh-btn-outline {
    background-color: var(--background);
    color: var(--foreground);
    border-color: var(--border);
}

.gh-btn-outline:hover {
    border-color: var(--primary);
}


/* Header — floating nav pill
   -------------------------------------------------------------------------- */

.gh-head {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: min(calc(100% - 2rem), 56rem);
    transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
}

.gh-head.is-hidden {
    transform: translateX(-50%) translateY(calc(-100% - 1.25rem));
    opacity: 0;
    pointer-events: none;
}

.gh-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    background-color: color-mix(in srgb, var(--background) 80%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.gh-head-logo {
    display: inline-flex;
    align-items: center;
    padding: 0 1rem 0 0.75rem;
}

.gh-head-logo img {
    max-height: 28px;
    width: auto;
}

.gh-head-brand {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    transition: color 0.2s var(--ease-out);
}

.gh-head-logo:hover .gh-head-brand {
    color: var(--primary);
}

.gh-head-dot,
.gh-foot-dot {
    color: var(--primary);
    font-size: 1.2em;
    line-height: 1;
}

.gh-head-menu {
    display: none;
    flex: 1;
}

.gh-head-menu .nav,
.gh-mobile-nav-menu .nav,
.gh-foot-menu .nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gh-head-menu .nav a {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--foreground);
    transition: color 0.2s var(--ease-out);
}

.gh-head-menu .nav a:hover {
    color: var(--primary);
}

.gh-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gh-head-cta {
    display: none;
}

/* Theme toggle */
.gh-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--foreground);
    transition: color 0.2s var(--ease-out);
}

.gh-theme-toggle:hover {
    color: var(--primary);
}

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

.gh-icon-moon {
    display: none;
}

html.dark .gh-icon-moon {
    display: block;
}

html.dark .gh-icon-sun {
    display: none;
}

/* Burger */
.gh-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    padding: 8px;
}

.gh-burger span {
    display: block;
    height: 1.5px;
    width: 100%;
    background-color: var(--foreground);
    transition: transform 0.25s var(--ease-out);
}

.gh-burger[aria-expanded="true"] span:first-child {
    transform: translateY(3.25px) rotate(45deg);
}

.gh-burger[aria-expanded="true"] span:last-child {
    transform: translateY(-3.25px) rotate(-45deg);
}

@media (min-width: 768px) {
    .gh-head-menu {
        display: flex;
        justify-content: center;
    }

    .gh-head-cta {
        display: inline-flex;
    }

    .gh-burger {
        display: none;
    }
}

/* Mobile drawer */
.gh-mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 90;
}

.gh-mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background-color: color-mix(in srgb, var(--background) 60%, transparent);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.gh-mobile-nav-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: min(85vw, 24rem);
    background-color: var(--background);
    border-left: 1px solid var(--border);
    padding: 6rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gh-mobile-nav-menu .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.gh-mobile-nav-menu .nav a {
    display: inline-block;
    padding: 0.5rem 0;
    font-size: 1.375rem;
    font-weight: 300;
    letter-spacing: -0.01em;
    transition: color 0.2s var(--ease-out);
}

.gh-mobile-nav-menu .nav a:hover {
    color: var(--primary);
}


/* Main layout
   -------------------------------------------------------------------------- */

.gh-main {
    padding-top: clamp(7rem, 12vw, 9rem);
    padding-bottom: 6rem;
    min-height: 60vh;
}

.gh-page-head {
    padding-bottom: clamp(3rem, 6vw, 4.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 56rem;
}

.gh-page-title {
    font-size: clamp(2.35rem, 4.5vw + 1.35rem, 5.85rem);
}

.gh-page-desc {
    color: var(--muted-foreground);
    font-weight: 300;
    font-size: 1.125rem;
    max-width: 65ch;
}

.gh-page-count {
    color: var(--muted-foreground);
}

.gh-page-count a {
    color: var(--primary);
}

.gh-author-head-image {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 1px solid var(--border);
}


/* Meta line: DATE · X MIN READ
   -------------------------------------------------------------------------- */

.gh-meta {
    color: var(--muted-foreground);
    letter-spacing: 0.14em;
}

.gh-meta-dot {
    margin: 0 0.5rem;
    color: var(--primary);
}


/* Tags — square chips, hairline borders
   -------------------------------------------------------------------------- */

.gh-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.gh-tag {
    color: var(--muted-foreground);
    border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    padding: 2px 8px;
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

a.gh-tag:hover {
    color: var(--primary);
    border-color: var(--primary);
}


/* Featured post (first post, first page)
   -------------------------------------------------------------------------- */

.gh-featured {
    display: block;
    margin-bottom: clamp(3rem, 6vw, 5rem);
}

.gh-featured-grid {
    display: grid;
    gap: 1.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .gh-featured-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }
}

.gh-featured-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.gh-featured-title {
    font-size: clamp(1.6rem, 2.6vw + 0.8rem, 2.6rem);
    line-height: 1.08;
    transition: color 0.2s var(--ease-out);
}

.gh-featured:hover .gh-featured-title {
    color: var(--primary);
}

.gh-featured-excerpt {
    color: var(--muted-foreground);
    font-weight: 300;
    max-width: 58ch;
}

.gh-readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--foreground);
}

.gh-readmore svg {
    width: 14px;
    height: 14px;
    opacity: 0.8;
    transition: transform 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.gh-featured:hover .gh-readmore .editorial-caps,
.gh-featured:hover .gh-readmore svg {
    color: var(--primary);
}

.gh-featured:hover .gh-readmore svg {
    transform: translate(2px, -2px);
}


/* Post rows — hairline-separated list
   -------------------------------------------------------------------------- */

.gh-feed {
    display: flex;
    flex-direction: column;
}

.gh-row {
    border-top: 1px solid var(--border);
}

.gh-feed > .gh-row:last-child {
    border-bottom: 1px solid var(--border);
}

.gh-row-link {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 0;
    transition: background-color 0.2s var(--ease-out);
}

@media (min-width: 768px) {
    .gh-row-link {
        gap: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
        margin-left: -1rem;
        margin-right: -1rem;
    }
}

.gh-row-link:hover {
    background-color: color-mix(in srgb, var(--primary) 5%, transparent);
}

.gh-row-body {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-width: 0;
}

.gh-row-title {
    font-size: clamp(1.25rem, 1.4vw + 0.85rem, 1.7rem);
    line-height: 1.12;
    transition: color 0.2s var(--ease-out);
}

.gh-row-link:hover .gh-row-title {
    color: var(--primary);
}

.gh-row-excerpt {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 300;
    line-height: 1.6;
    max-width: 62ch;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gh-row-aside {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.gh-row-image {
    display: none;
    width: 220px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.gh-row-image img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    width: 100%;
}

@media (min-width: 900px) {
    .gh-row-image {
        display: block;
    }
}

.gh-row-arrow {
    width: 18px;
    height: 18px;
    color: var(--muted-foreground);
    transition: transform 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.gh-row-link:hover .gh-row-arrow {
    color: var(--primary);
    transform: translate(2px, -2px);
}


/* Pagination
   -------------------------------------------------------------------------- */

.gh-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.gh-pagination-link {
    color: var(--foreground);
    transition: color 0.2s var(--ease-out);
}

.gh-pagination-link:hover {
    color: var(--primary);
}

.gh-pagination-link:last-child {
    text-align: right;
}

.gh-pagination-count {
    color: var(--muted-foreground);
    text-align: center;
}


/* Article
   -------------------------------------------------------------------------- */

.gh-article-inner {
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.gh-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    align-self: flex-start;
    color: var(--muted-foreground);
    transition: color 0.2s var(--ease-out);
}

.gh-back svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s var(--ease-out);
}

.gh-back:hover {
    color: var(--primary);
}

.gh-back:hover svg {
    transform: translateX(-2px);
}

.gh-article-header {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.gh-article-title {
    font-size: clamp(2rem, 3.4vw + 1.1rem, 3.5rem);
    line-height: 1.06;
}

.gh-article-excerpt {
    color: var(--muted-foreground);
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.65;
    max-width: 65ch;
}

.gh-article-byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.gh-byline-author {
    font-weight: 300;
    transition: color 0.2s var(--ease-out);
}

.gh-byline-author:hover {
    color: var(--primary);
}

.gh-article-image figcaption {
    padding: 0.75rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-align: center;
}

.gh-article-image figcaption a {
    color: var(--primary);
}

figure.gh-article-image {
    margin: 0;
}


/* Article footer / author card
   -------------------------------------------------------------------------- */

.gh-article-footer {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gh-author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gh-author-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.gh-author-name {
    font-weight: 500;
    transition: color 0.2s var(--ease-out);
}

.gh-author-card:hover .gh-author-name {
    color: var(--primary);
}

.gh-author-bio {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 300;
}


/* Read next
   -------------------------------------------------------------------------- */

.gh-read-next {
    margin-top: clamp(4rem, 8vw, 6rem);
}

.gh-read-next .gh-container {
    max-width: var(--container-narrow);
}

.gh-read-next-title {
    margin-bottom: 1.5rem;
}


/* Content (Koenig editor output)
   -------------------------------------------------------------------------- */

.gh-content {
    display: flex;
    flex-direction: column;
    font-weight: 300;
    line-height: 1.65;
}

.gh-content > * {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.gh-content > [id] {
    margin-top: 1.5rem;
    scroll-margin-top: 6rem;
}

.gh-content h1 { font-size: 2.25rem; }
.gh-content h2 { font-size: 1.85rem; }
.gh-content h3 { font-size: 1.5rem; }
.gh-content h4 { font-size: 1.25rem; }
.gh-content h5,
.gh-content h6 { font-size: 1.0625rem; }

.gh-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s var(--ease-out);
}

.gh-content a:hover {
    text-decoration-color: var(--primary);
}

.gh-content strong {
    font-weight: 700;
    color: var(--foreground);
}

.gh-content ul,
.gh-content ol {
    padding-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gh-content li::marker {
    color: var(--primary);
}

.gh-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding-left: 1.25rem;
    border-left: 3px solid color-mix(in srgb, var(--primary) 40%, transparent);
    color: var(--muted-foreground);
    font-style: italic;
}

.gh-content blockquote.kg-blockquote-alt {
    border: 0;
    padding: 0;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1.3;
    text-align: center;
    color: var(--foreground);
}

.gh-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875em;
    background-color: var(--muted);
    border: 1px solid var(--border);
    padding: 0.125em 0.375em;
}

.gh-content pre {
    background-color: #1f1f1f;
    color: #fff6e0;
    border: 1px solid var(--border);
    padding: 1.25rem;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.6;
}

.gh-content pre code {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
}

.gh-content hr {
    margin: 2.5rem 0;
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.gh-content th,
.gh-content td {
    text-align: left;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
}

.gh-content th {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.gh-content img {
    border: 1px solid var(--border);
}

.gh-content figure {
    margin-left: 0;
    margin-right: 0;
}

.gh-content figcaption {
    padding-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--muted-foreground);
    text-align: center;
}

.gh-content .kg-image {
    margin-left: auto;
    margin-right: auto;
}

/* Koenig width breakouts */
.gh-content .kg-width-wide {
    position: relative;
    width: min(65rem, calc(100vw - 2 * var(--gutter)));
    left: 50%;
    transform: translateX(-50%);
}

.gh-content .kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
}

.gh-content .kg-width-full img {
    border-left: 0;
    border-right: 0;
}

/* Koenig cards that ship their own chrome: keep our square, flat language */
.gh-content .kg-card {
    font-weight: 400;
}

.gh-content .kg-callout-card,
.gh-content .kg-bookmark-container,
.gh-content .kg-product-card-container,
.gh-content .kg-toggle-card,
.gh-content .kg-header-card,
.gh-content .kg-signup-card {
    border-radius: 0 !important;
}

.gh-content .kg-bookmark-container {
    border: 1px solid var(--border) !important;
    background-color: var(--card) !important;
    color: var(--foreground) !important;
    box-shadow: none !important;
}

.gh-content .kg-bookmark-title,
.gh-content .kg-bookmark-description,
.gh-content .kg-bookmark-metadata {
    color: inherit !important;
}

.gh-content .kg-btn,
.gh-content .kg-button-card a {
    border-radius: 0 !important;
}

.gh-content .kg-embed-card iframe {
    max-width: 100%;
}


/* Comments
   -------------------------------------------------------------------------- */

.gh-comments {
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}


/* Error page
   -------------------------------------------------------------------------- */

.gh-error {
    min-height: 45vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.25rem;
}

.gh-error-code {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 1;
    color: var(--primary);
}

.gh-error-message {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
}


/* Footer — solid cobalt band
   -------------------------------------------------------------------------- */

.gh-foot {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.gh-foot-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 3rem var(--gutter);
}

.gh-foot-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

@media (min-width: 768px) {
    .gh-foot-top {
        flex-direction: row;
        align-items: center;
    }
}

.gh-foot-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gh-foot-logo {
    font-size: 1.25rem;
    font-weight: 300;
    letter-spacing: -0.02em;
}

.gh-foot-dot {
    color: color-mix(in srgb, var(--primary-foreground) 70%, var(--primary));
}

.gh-foot-tagline {
    font-size: 0.875rem;
    font-weight: 300;
    color: color-mix(in srgb, var(--primary-foreground) 75%, var(--primary));
    max-width: 42ch;
}

.gh-foot-menu .nav {
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
}

.gh-foot-menu .nav a {
    font-size: 0.875rem;
    color: color-mix(in srgb, var(--primary-foreground) 75%, var(--primary));
    transition: color 0.2s var(--ease-out);
}

.gh-foot-menu .nav a:hover {
    color: var(--primary-foreground);
}

.gh-foot-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid color-mix(in srgb, var(--primary-foreground) 25%, transparent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.75rem;
    color: color-mix(in srgb, var(--primary-foreground) 75%, var(--primary));
}

@media (min-width: 768px) {
    .gh-foot-bottom {
        flex-direction: row;
    }
}

.gh-foot-bottom a {
    color: inherit;
    transition: color 0.2s var(--ease-out);
}

.gh-foot-bottom a:hover {
    color: var(--primary-foreground);
}


/* Landing page (home.hbs)
   -------------------------------------------------------------------------- */

.gh-landing {
    padding-top: 0;
    padding-bottom: 0;
}

.gh-landing section[id] {
    scroll-margin-top: 5rem;
}

/* Hero */

.gh-hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7rem var(--gutter) 3rem;
}

.gh-hero-inner {
    width: 100%;
    max-width: 64rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.75rem, 4vw, 2.75rem);
}

.gh-hero-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    padding-bottom: clamp(1rem, 4vw, 3rem);
}

@media (min-width: 768px) {
    .gh-hero-top {
        flex-direction: row;
        gap: 0;
    }

    .gh-hero-frame {
        margin-right: -6rem;
    }
}

.gh-hero-frame {
    position: relative;
    z-index: 2;
    max-width: 44ch;
    padding: 1rem 1.5rem;
    border: 1px solid var(--primary);
    background-color: color-mix(in srgb, var(--background) 10%, transparent);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    text-align: center;
}

.gh-hero-line {
    display: block;
    font-weight: 300;
    letter-spacing: -0.02em;
    font-size: clamp(2.35rem, 12vw, 4.85rem);
    line-height: 1.05;
    background-image: linear-gradient(to right, var(--foreground), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gh-hero-line-accent {
    font-style: italic;
    font-size: clamp(2.75rem, 14vw, 6.75rem);
    line-height: 0.98;
    margin-top: 0.5rem;
}

/* Cube grid — decorative pixel-cube field beside the hero headline */
.gh-cubes {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 9px;
    width: min(72vw, 290px);
    aspect-ratio: 1;
    flex-shrink: 0;
    perspective: 800px;
}

.gh-cube {
    background-color: var(--background);
    border: 1px dashed var(--primary);
    transform-style: preserve-3d;
    animation: gh-cube-ripple 4.5s infinite var(--ease-out);
    animation-delay: calc(var(--d) * 0.22s);
}

@keyframes gh-cube-ripple {
    0%, 100% {
        transform: rotate3d(1, 1, 0, 0deg);
        border-color: var(--primary);
    }
    12% {
        transform: rotate3d(1, 1, 0, 32deg);
        border-color: #91c5ff;
    }
    28% {
        transform: rotate3d(1, 1, 0, 0deg);
        border-color: var(--primary);
    }
}

.gh-hero-tagline {
    text-align: center;
    color: var(--muted-foreground);
    font-weight: 300;
    font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
    line-height: 1.65;
    max-width: min(40rem, 65ch);
}

.gh-hero-rule {
    width: 6rem;
    height: 2px;
    background-color: color-mix(in srgb, var(--primary) 35%, transparent);
}

.gh-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
}

.gh-btn-lg {
    font-size: 1.125rem;
    padding: 10px 18px;
}

.gh-btn svg {
    width: 1em;
    height: 1em;
    transition: transform 0.2s var(--ease-out);
}

.gh-btn:hover svg {
    transform: translateX(3px);
}

/* Section scaffolding */

.gh-section {
    padding: clamp(3.75rem, 8vw, 6.25rem) 0;
}

.gh-section-head {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: clamp(2.75rem, 7vw, 5rem);
}

@media (min-width: 1024px) {
    .gh-section-head {
        flex-direction: row;
        align-items: flex-end;
        gap: 2.5rem;
    }
}

.gh-section-label {
    color: var(--muted-foreground);
    margin-bottom: 1.125rem;
    letter-spacing: 0.16em;
}

.gh-section-title {
    font-size: clamp(2.1rem, 3.6vw + 1.1rem, 4.65rem);
    line-height: 1.04;
}

.gh-italic-primary,
.gh-accent {
    color: var(--primary);
}

.gh-italic-primary,
.gh-italic-light {
    font-style: italic;
}

.gh-section-side {
    max-width: 62ch;
    color: var(--muted-foreground);
    line-height: 1.55;
}

.gh-section-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--foreground);
    transition: color 0.2s var(--ease-out);
    padding-bottom: 0.5rem;
}

.gh-section-more svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s var(--ease-out);
}

.gh-section-more:hover {
    color: var(--primary);
}

.gh-section-more:hover svg {
    transform: translate(2px, -2px);
}

/* Capabilities index — numbered like a monograph's table of contents */

.gh-index {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.gh-index-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem 2.5rem;
    align-items: baseline;
    padding: 1.75rem 0;
    border-top: 1px solid var(--border);
    transition: background-color 0.2s var(--ease-out);
}

.gh-index-row:last-child {
    border-bottom: 1px solid var(--border);
}

.gh-index-row:hover {
    background-color: color-mix(in srgb, var(--primary) 5%, transparent);
}

.gh-index-num {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    transition: color 0.2s var(--ease-out);
    min-width: 3rem;
}

.gh-index-row:hover .gh-index-num {
    color: var(--primary);
}

.gh-index-title {
    font-size: clamp(1.375rem, 1.5vw + 0.9rem, 1.85rem);
    line-height: 1.12;
    margin-bottom: 0.375rem;
}

.gh-index-desc {
    color: var(--muted-foreground);
    font-weight: 300;
    max-width: 62ch;
}

/* Work cards — flat bordered blocks with metric chips */

.gh-work-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 700px) {
    .gh-work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gh-work-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gh-work-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    background-color: var(--card);
    transition: border-color 0.2s var(--ease-out);
}

.gh-work-card:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
}

.gh-work-tagline {
    color: var(--primary);
    letter-spacing: 0.16em;
}

.gh-work-title {
    font-size: 1.85rem;
}

.gh-work-desc {
    color: var(--muted-foreground);
    font-weight: 300;
    font-size: 0.9375rem;
    line-height: 1.6;
    flex-grow: 1;
}

.gh-work-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.gh-metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.gh-metric-value {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 1.5rem;
    color: var(--primary);
    line-height: 1;
}

.gh-metric-desc {
    font-size: 0.75rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

.gh-work-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--foreground);
    transition: color 0.2s var(--ease-out);
}

.gh-work-link svg {
    width: 13px;
    height: 13px;
    transition: transform 0.2s var(--ease-out);
}

.gh-work-link:hover {
    color: var(--primary);
}

.gh-work-link:hover svg {
    transform: translate(2px, -2px);
}

/* Contact — the ground fades into the cobalt band; the footer continues it */

.gh-contact {
    padding: clamp(5rem, 11vw, 8rem) 0 clamp(4rem, 8vw, 6rem);
    background-image: linear-gradient(to bottom, var(--background) 1%, var(--primary) 72%);
    color: var(--primary-foreground);
}

.gh-contact-head {
    max-width: 48rem;
    margin-bottom: clamp(3rem, 8vw, 5rem);
}

.gh-contact-label {
    margin-bottom: 1.125rem;
    letter-spacing: 0.16em;
    color: var(--foreground);
}

.gh-contact .gh-section-title {
    color: var(--foreground);
}

.gh-contact-grid {
    display: grid;
    gap: 3.5rem;
    color: var(--primary-foreground);
}

@media (min-width: 1024px) {
    .gh-contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: clamp(4rem, 12vw, 8rem);
    }
}

.gh-contact-details {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.gh-contact-item-label {
    margin-bottom: 0.75rem;
    color: color-mix(in srgb, var(--primary-foreground) 80%, var(--primary));
    letter-spacing: 0.14em;
}

.gh-contact-item p {
    line-height: 1.65;
}

.gh-contact-item a {
    transition: opacity 0.2s var(--ease-out);
}

.gh-contact-item a:hover {
    opacity: 0.75;
}

.gh-contact-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.65;
    max-width: 40ch;
}

.gh-btn-cream {
    background-color: var(--primary-foreground);
    color: #2563eb;
}

.gh-btn-cream:hover {
    filter: brightness(0.96);
}


/* Reduced motion
   -------------------------------------------------------------------------- */

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

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
