/* =========================================================================
   CounTree Concepts — components
   ====================================================================== */

/* -------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    padding: 0.8rem 1.65rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background-color: var(--primary);
    color: var(--text-invert);
    font-size: var(--fs-small);
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    transition: background-color var(--dur) var(--ease),
                border-color var(--dur) var(--ease),
                color var(--dur) var(--ease);
}

.btn:hover { background-color: var(--primary-dark); }

.btn-outline {
    background-color: transparent;
    border-color: var(--border-strong);
    color: var(--text);
}

.btn-outline:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-invert);
}

.btn-invert {
    background-color: var(--text-invert);
    color: var(--primary-dark);
}

.btn-invert:hover { background-color: #fff; }

.btn-ghost-invert {
    background-color: transparent;
    border-color: var(--border-invert);
    color: var(--text-invert);
}

.btn-ghost-invert:hover {
    background-color: rgba(244, 242, 235, 0.12);
    border-color: rgba(244, 242, 235, 0.5);
}

.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* Inline text link with an underline that grows from the left on hover.
   Transform-only, so it costs nothing to animate. */
.link {
    position: relative;
    display: inline-block;
    font-weight: 600;
    font-size: var(--fs-small);
    padding-bottom: 3px;
    color: var(--text);
}

.link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0.36);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
}

.link:hover::after,
.link:focus-visible::after { transform: scaleX(1); }

.on-dark .link { color: var(--text-invert); }

/* -------------------------------------------------------------------------
   Navigation
   ---------------------------------------------------------------------- */

.nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background-color: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color var(--dur) var(--ease),
                border-color var(--dur) var(--ease),
                box-shadow var(--dur) var(--ease);
}

.nav-inner {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.nav-logo {
    display: flex;
    align-items: center;
    flex: none;
}

.nav-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-logo-light { display: block; }
.nav-logo-dark  { display: none; }

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 2.4vw, 2.25rem);
    list-style: none;
}

.nav-link {
    position: relative;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--text-invert);
    padding-block: 0.4rem;
    transition: color var(--dur) var(--ease);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: var(--space-sm); }

.nav-cta {
    min-height: 42px;
    padding: 0.5rem 1.2rem;
    font-size: var(--fs-micro);
}

/* Solid state, toggled by main.js once the hero sentinel leaves the viewport,
   and always on for pages without a full-bleed hero. */
.nav.is-solid,
.nav-static {
    background-color: rgba(251, 250, 246, 0.94);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    backdrop-filter: saturate(140%) blur(8px);
    border-bottom-color: var(--border);
}

.nav.is-solid .nav-link,
.nav-static .nav-link { color: var(--text); }

.nav.is-solid .nav-logo-light,
.nav-static .nav-logo-light { display: none; }

.nav.is-solid .nav-logo-dark,
.nav-static .nav-logo-dark { display: block; }

.nav.is-solid .nav-cta.btn-ghost-invert,
.nav-static .nav-cta.btn-ghost-invert {
    border-color: var(--border-strong);
    color: var(--text);
}

.nav.is-solid .nav-cta.btn-ghost-invert:hover,
.nav-static .nav-cta.btn-ghost-invert:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--text-invert);
}

.nav.is-solid .nav-toggle-bar,
.nav-static .nav-toggle-bar { background-color: var(--text); }

/* Hamburger */
.nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 0;
}

.nav-toggle-box {
    display: grid;
    gap: 6px;
    width: 24px;
}

.nav-toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-invert);
    transition: transform var(--dur) var(--ease),
                opacity 140ms linear,
                background-color var(--dur) var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile panel */
.nav-panel {
    position: fixed;
    inset: 0;
    z-index: 99;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--primary-dark);
    color: var(--text-invert);
    padding: calc(var(--nav-height) + var(--space-lg)) var(--gutter) var(--space-xl);
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -12px, 0);
    transition: opacity var(--dur) var(--ease),
                transform var(--dur) var(--ease),
                visibility 0s linear var(--dur);
}

.nav-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
    transition-delay: 0s;
}

.nav-panel-list {
    list-style: none;
    display: grid;
    gap: var(--space-xs);
}

.nav-panel-link {
    display: block;
    padding: 0.7rem 0;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    font-weight: 500;
    line-height: 1.15;
    border-bottom: 1px solid var(--border-invert);
}

.nav-panel-link[aria-current="page"] { color: var(--accent); }

.nav-panel-foot {
    margin-top: var(--space-xl);
    display: grid;
    gap: var(--space-xs);
    font-size: var(--fs-small);
    color: var(--text-invert-mu);
}

/* -------------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------- */

.hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(92vh, 860px);
    padding-top: calc(var(--nav-height) + var(--space-xl));
    padding-bottom: var(--space-xl);
    background-color: var(--primary-deep);
    color: var(--text-invert);
    overflow: hidden;
    isolation: isolate;
}

.hero-media {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Two-stop scrim: heavy on the left where the type sits, light on the right
   so the photograph still reads. Keeps contrast above 7:1 for the headline. */
.hero-scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(100deg, rgba(20, 28, 15, 0.93) 0%, rgba(20, 28, 15, 0.78) 38%, rgba(20, 28, 15, 0.30) 78%, rgba(20, 28, 15, 0.42) 100%),
        linear-gradient(to top, rgba(20, 28, 15, 0.75) 0%, rgba(20, 28, 15, 0) 45%);
}

.hero-content {
    position: relative;
    max-width: 44rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: var(--fs-display);
    font-weight: 500;
    line-height: 1.02;
    letter-spacing: -0.024em;
    max-width: 16ch;
    text-wrap: balance;
}

.hero-text {
    margin-top: var(--space-md);
    font-size: var(--fs-lead);
    line-height: 1.55;
    color: var(--text-invert-mu);
    max-width: 48ch;
}

.hero-actions { margin-top: var(--space-lg); }

/* Project index along the foot of the hero — the site's portfolio, legible
   before a single scroll. */
.hero-index {
    margin-top: var(--space-2xl);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-invert);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-md);
    list-style: none;
}

.hero-index-item {
    display: grid;
    gap: 0.2rem;
}

.hero-index-name {
    font-size: var(--fs-small);
    font-weight: 700;
}

.hero-index-meta {
    font-size: var(--fs-micro);
    color: var(--text-invert-mu);
}

/* Compact page hero for interior pages */
.page-hero {
    position: relative;
    padding-top: calc(var(--nav-height) + var(--space-2xl));
    padding-bottom: var(--space-xl);
    background-color: var(--primary-dark);
    color: var(--text-invert);
    overflow: hidden;
    isolation: isolate;
}

.page-hero-media { position: absolute; inset: 0; z-index: -2; }

.page-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(95deg, rgba(31, 42, 24, 0.95) 0%, rgba(31, 42, 24, 0.82) 45%, rgba(31, 42, 24, 0.55) 100%);
}

.page-hero-title { max-width: 18ch; }

.page-hero-text {
    margin-top: var(--space-md);
    font-size: var(--fs-lead);
    color: var(--text-invert-mu);
    max-width: 52ch;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    font-size: var(--fs-micro);
    color: var(--text-invert-mu);
    margin-bottom: var(--space-md);
}

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

.breadcrumb-sep { opacity: 0.55; }

/* -------------------------------------------------------------------------
   Editorial rows — the project showcase
   Alternating image / text bands rather than a repeated card grid.
   ---------------------------------------------------------------------- */

.editorial {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    padding-block: var(--space-xl);
    border-top: 1px solid var(--border);
}

.editorial-flip .editorial-media { order: 2; }

.editorial-media {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background-color: var(--surface-sunk);
    aspect-ratio: 16 / 11;
}

.editorial-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 700ms var(--ease);
}

.editorial:hover .editorial-media img { transform: scale(1.035); }

.editorial-body { min-width: 0; }

.editorial-title {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.014em;
}

.editorial-place {
    margin-top: 0.4rem;
    font-size: var(--fs-small);
    color: var(--text-muted);
}

.editorial-text {
    margin-top: var(--space-md);
    color: var(--text-muted);
    max-width: 46ch;
}

.editorial-actions { margin-top: var(--space-md); }

/* Project facts as a definition list — the correct semantics for
   label/value pairs, and it reads cleanly on a phone. */
.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm) var(--space-md);
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.facts-dt {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.facts-dd {
    margin: 0;
    font-size: var(--fs-small);
    font-weight: 600;
}

.on-dark .facts,
.section-dark .facts { border-color: var(--border-invert); }

.on-dark .facts-dt,
.section-dark .facts-dt { color: var(--text-invert-mu); }

/* -------------------------------------------------------------------------
   Project cards (projects listing)
   ---------------------------------------------------------------------- */

.project-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.project-card:hover {
    border-color: var(--border-strong);
    transform: translate3d(0, -3px, 0);
}

.project-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--surface-sunk);
}

.project-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 700ms var(--ease);
}

.project-card:hover .project-card-media img { transform: scale(1.04); }

.project-card-body {
    padding: var(--space-md);
    display: grid;
    align-content: start;
    gap: 0.4rem;
}

.project-card-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.2;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--accent-dark);
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
    flex: none;
}

.on-dark .status,
.section-dark .status { color: var(--accent); }

/* Whole-card link without nesting interactive elements. */
.stretched::after {
    content: "";
    position: absolute;
    inset: 0;
}

/* -------------------------------------------------------------------------
   Figures, numbers, lists
   ---------------------------------------------------------------------- */

.figures {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-md);
}

.figure-item {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-invert);
}

.figure-value {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.02em;
}

.figure-label {
    margin-top: 0.5rem;
    font-size: var(--fs-small);
    color: var(--text-invert-mu);
}

/* Numbered only because plan → design → construct is a real sequence. */
.steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-lg);
    counter-reset: step;
}

.step-item {
    counter-increment: step;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.step-item::before {
    content: counter(step, decimal-leading-zero);
    display: block;
    font-size: var(--fs-micro);
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: var(--space-xs);
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.ticks {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 0.65rem var(--space-md);
}

.tick-item {
    position: relative;
    padding-left: 1.4rem;
    font-size: var(--fs-small);
    line-height: 1.5;
}

.tick-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 8px;
    height: 1px;
    background-color: var(--accent);
}

.value-list {
    list-style: none;
    display: grid;
    gap: var(--space-lg);
}

.value-item {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.section-dark .value-item,
.section-dark .step-item,
.section-dark .facts,
.section-dark .editorial { border-color: var(--border-invert); }

/* Collaborators */
.collab-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-lg);
}

.collab-item {
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--text-muted);
}

/* -------------------------------------------------------------------------
   Hobbitinn identity block
   The project keeps its own visual register — deeper green, gold rules —
   while sitting inside the CounTree layout system.
   ---------------------------------------------------------------------- */

.brand-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: min(88vh, 800px);
    padding-top: calc(var(--nav-height) + var(--space-2xl));
    padding-bottom: var(--space-xl);
    background-color: #1A2313;
    color: var(--text-invert);
    overflow: hidden;
    isolation: isolate;
}

.brand-hero-media { position: absolute; inset: 0; z-index: -2; }

.brand-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-hero-scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(to top, rgba(17, 24, 12, 0.94) 0%, rgba(17, 24, 12, 0.55) 45%, rgba(17, 24, 12, 0.35) 100%),
        linear-gradient(95deg, rgba(17, 24, 12, 0.72) 0%, rgba(17, 24, 12, 0.18) 70%);
}

/* The logo sits in normal flow above the text, in a grid with an explicit
   gap. Nothing here is absolutely positioned, so the mark can never
   collide with the headline at any width. */
.brand-lockup {
    display: grid;
    justify-items: start;
    gap: var(--space-lg);
    max-width: 46rem;
}

.brand-logo {
    width: clamp(150px, 26vw, 250px);
    height: auto;
    flex: none;
}

.brand-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -0.02em;
    max-width: 18ch;
    text-wrap: balance;
}

.brand-hero-text {
    font-size: var(--fs-lead);
    color: var(--text-invert-mu);
    max-width: 50ch;
}

.brand-band {
    background-color: #1F2A18;
    color: var(--text-invert);
}

.brand-band .h2,
.brand-band .h3 { color: var(--text-invert); }

/* -------------------------------------------------------------------------
   Gallery + lightbox
   ---------------------------------------------------------------------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
}

.gallery-item {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--surface-sunk);
    aspect-ratio: 4 / 3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease);
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item-wide { grid-column: span 2; aspect-ratio: 8 / 3; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 4vw, 3rem);
    background-color: rgba(12, 17, 9, 0.94);
}

.lightbox.is-open { display: flex; }

.lightbox-figure {
    margin: 0;
    max-width: min(1100px, 100%);
    max-height: 100%;
    display: grid;
    gap: var(--space-sm);
}

.lightbox-figure img {
    max-height: 78vh;
    width: auto;
    margin-inline: auto;
    border-radius: var(--radius);
    object-fit: contain;
}

.lightbox-caption {
    text-align: center;
    color: var(--text-invert-mu);
    font-size: var(--fs-small);
}

.lightbox-btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-invert);
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-invert);
    font-size: 1.25rem;
    line-height: 1;
    transition: background-color var(--dur) var(--ease);
}

.lightbox-btn:hover { background-color: rgba(255, 255, 255, 0.18); }

.lightbox-close { top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2rem); }
.lightbox-prev  { left: clamp(0.5rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: clamp(0.5rem, 3vw, 2rem); top: 50%; transform: translateY(-50%); }

/* -------------------------------------------------------------------------
   Map
   ---------------------------------------------------------------------- */

.map-frame {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--surface-sunk);
    aspect-ratio: 16 / 9;
}

.map-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(0.35) contrast(1.02);
}

/* -------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------- */

.form { display: grid; gap: var(--space-md); }

.field { display: grid; gap: 0.4rem; }

.field-label {
    font-size: var(--fs-small);
    font-weight: 600;
}

.field-hint {
    font-size: var(--fs-micro);
    color: var(--text-muted);
}

.field-input,
.field-textarea {
    width: 100%;
    min-height: 50px;
    padding: 0.75rem 0.9rem;
    background-color: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: var(--fs-body);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.field-textarea {
    min-height: 170px;
    resize: vertical;
    line-height: 1.55;
}

.field-input:focus,
.field-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(49, 65, 39, 0.14);
}

.field-input[aria-invalid="true"],
.field-textarea[aria-invalid="true"] { border-color: var(--danger); }

.field-error {
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--danger);
    min-height: 1em;
}

/* Honeypot: hidden from people, present for bots. */
.field-trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.alert {
    padding: var(--space-md);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background-color: var(--surface);
    font-size: var(--fs-small);
}

.alert-success { border-left-color: var(--success); }
.alert-error   { border-left-color: var(--danger); }

.alert-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* -------------------------------------------------------------------------
   Contact details
   ---------------------------------------------------------------------- */

.office-list {
    list-style: none;
    display: grid;
    gap: var(--space-md);
}

.office-item {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.office-label {
    font-size: var(--fs-micro);
    color: var(--accent-dark);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.office-address {
    font-size: var(--fs-small);
    color: var(--text-muted);
    max-width: 40ch;
}

/* -------------------------------------------------------------------------
   Call to action band
   ---------------------------------------------------------------------- */

.cta {
    background-color: var(--primary);
    color: var(--text-invert);
}

.cta-inner {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-lg);
    align-items: end;
}

.cta-title {
    font-family: var(--font-display);
    font-size: var(--fs-h1);
    font-weight: 500;
    line-height: 1.08;
    letter-spacing: -0.018em;
    max-width: 16ch;
}

/* -------------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */

.footer {
    background-color: var(--primary-deep);
    color: var(--text-invert);
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.6fr));
    gap: var(--space-lg);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-invert);
}

.footer-logo {
    height: 44px;
    width: auto;
    margin-bottom: var(--space-md);
}

.footer-about {
    font-size: var(--fs-small);
    color: var(--text-invert-mu);
    max-width: 34ch;
}

.footer-heading {
    font-size: var(--fs-micro);
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.footer-list {
    list-style: none;
    display: grid;
    gap: 0.55rem;
    font-size: var(--fs-small);
}

.footer-list a { color: var(--text-invert-mu); transition: color var(--dur) var(--ease); }
.footer-list a:hover { color: var(--text-invert); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    font-size: var(--fs-micro);
    color: var(--text-invert-mu);
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    list-style: none;
}

.footer-social a { transition: color var(--dur) var(--ease); }
.footer-social a:hover { color: var(--accent); }

/* -------------------------------------------------------------------------
   404
   ---------------------------------------------------------------------- */

.error-page {
    min-height: 74vh;
    display: flex;
    align-items: center;
    padding-top: calc(var(--nav-height) + var(--space-xl));
    padding-bottom: var(--space-2xl);
}

.error-code {
    font-family: var(--font-display);
    font-size: clamp(4rem, 14vw, 9rem);
    font-weight: 500;
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: var(--primary);
}


/* -------------------------------------------------------------------------
   Hobbitinn wordmark

   Used when the official artwork has not been supplied yet. Set in the brand
   serif with the filigree mark above it, matching the real identity, and
   carrying no "Islamabad". Live text, so it stays sharp at any size and can
   never be stretched.
   ---------------------------------------------------------------------- */

.wordmark {
    display: grid;
    justify-items: start;
    gap: 0.45rem;
    color: var(--text-invert);
    line-height: 1;
}

.wordmark-mark {
    width: clamp(88px, 13vw, 118px);
    height: auto;
    opacity: 0.9;
}

.wordmark-name {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 1.2rem + 2.3vw, 3rem);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-indent: 0.16em;          /* balances the trailing letter-space */
}

.wordmark-sub {
    font-size: clamp(0.6rem, 0.5rem + 0.25vw, 0.72rem);
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-indent: 0.3em;
    color: var(--accent);
}

.wordmark-sm .wordmark-name { font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); }
.wordmark-sm .wordmark-mark { width: clamp(72px, 10vw, 92px); }

/* -------------------------------------------------------------------------
   Partners

   An indexed list rather than a row of plain words: each entry carries its
   discipline, which is the information a visitor actually wants.
   ---------------------------------------------------------------------- */

.partners {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background-color: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.partner {
    display: grid;
    align-content: space-between;
    gap: var(--space-lg);
    min-height: 190px;
    padding: var(--space-md);
    background-color: var(--surface);
    transition: background-color var(--dur) var(--ease);
}

.partner:hover { background-color: var(--background); }

.partner-name {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.2;
}

.partner-role {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.partner-index {
    font-size: var(--fs-micro);
    font-weight: 700;
    color: var(--accent-dark);
}

.partner-logo {
    width: auto;
    max-width: 130px;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: var(--space-sm);
    /* Partner logos arrive in mixed colours. Desaturating settles them into
       the page; full colour returns on hover. */
    filter: grayscale(1) contrast(0.9);
    opacity: 0.75;
    transition: filter var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.partner:hover .partner-logo {
    filter: none;
    opacity: 1;
}


/* A delivered project is not an active sales status, so its marker is the
   quiet stone tone rather than the gold used for "selling now". */
.status-done { color: var(--text-muted); }
.status-done::before { background-color: var(--border-strong); }

/* ---------------------------------------------------- staff login (footer) */
/* Deliberately understated: the CRM is internal, so the link is present for
   staff who look for it without drawing a visitor's eye. */
.footer-staff {
    margin: 0;
}
.footer-staff a {
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.55;
    text-decoration: none;
}
.footer-staff a:hover,
.footer-staff a:focus-visible {
    opacity: 1;
    text-decoration: underline;
}
