/* Borås Byggplanering
   Colours are taken from the firm's prize-winning Viared print house: the ochre
   facade, the steel-blue window frames, charcoal. Its round windows are the
   page's one motif (.porthole). No rules, no shadows, no gradients: surfaces
   are separated by flat fields of colour and by space. */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter.woff2") format("woff2");
    font-weight: 300 700;
    font-display: swap;
}
@font-face {
    font-family: "Roboto Condensed";
    src: url("../fonts/roboto-condensed.woff2") format("woff2");
    font-weight: 300 800;
    font-display: swap;
}

:root {
    --ground: #f2f2f0;
    --tone: #e5e4e0;
    --ink: #161616;
    --ink-soft: #55534f;
    --ochre: #d08a35;
    --blue: #213f94;
    --blue-dark: #182f70;
    --dark: #161616;
    --on-dark: #f2f2f0;
    --on-dark-soft: #a9a6a0;

    --display: "Roboto Condensed", "Helvetica Neue Condensed", "Arial Narrow", sans-serif;
    --text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --margin: clamp(16px, 2.4vw, 36px);
    --gap: clamp(16px, 2vw, 32px);
    --section: clamp(96px, 11vw, 176px);
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 400 18px/1.55 var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1, h2 {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 0.98;
    text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5.4vw, 6rem); }
h2 { font-size: clamp(2rem, 3.9vw, 4.2rem); }
h3 { font: 700 1.3rem/1.2 var(--display); letter-spacing: 0; }
::selection { background: var(--ochre); color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.wrap { max-width: 1800px; margin: 0 auto; padding: 0 var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--ink); color: var(--on-dark); padding: 10px 16px; }
.skip-link:focus { top: 8px; }

.lede { font-size: clamp(1.1rem, 1.45vw, 1.35rem); line-height: 1.5; max-width: 34em; }
.small { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Buttons & links ---------- */
.button {
    display: inline-block;
    padding: 18px 30px;
    background: var(--blue); color: #fff;
    font: 600 1rem/1 var(--text);
    text-decoration: none;
    transition: background-color .2s, transform .15s var(--ease);
}
.button:hover { background: var(--blue-dark); }
.button:active { transform: translateY(1px); }
.button--light { background: var(--on-dark); color: var(--ink); }
.button--light:hover { background: #fff; }

.more {
    font-weight: 600; text-decoration: underline; text-underline-offset: 5px;
    text-decoration-thickness: 2px; text-decoration-color: var(--ochre);
    transition: text-underline-offset .2s;
}
.more::after { content: " →"; }
.more:hover { text-underline-offset: 8px; }

/* ---------- Domain notice & header ---------- */
.notice-bar { background: var(--ochre); color: var(--ink); font-size: 0.9rem; padding: 10px 0; }
.notice-bar a { font-weight: 600; }

.site-header { position: sticky; top: 0; z-index: 50; background: var(--ground); }
.header-inner { display: flex; align-items: center; gap: 32px; height: 84px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-right: auto; }
.brand-logo { width: 168px; height: auto; }

.main-nav ul { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.main-nav a { font-size: 1rem; font-weight: 500; text-decoration: none; padding: 6px 0; }
.main-nav a:not(.button):hover, .main-nav a[aria-current="page"] {
    text-decoration: underline; text-decoration-thickness: 2px;
    text-underline-offset: 6px; text-decoration-color: var(--ochre);
}
.main-nav .button { padding: 14px 22px; }
.nav-toggle { display: none; }

/* ---------- The round window ---------- */
.porthole { border-radius: 50%; aspect-ratio: 1; object-fit: cover; }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 6vw, 96px) 0 var(--section); }
.hero .grid { align-items: end; }
.hero-text { grid-column: 1 / span 6; padding-bottom: 8px; }
.hero-text .lede { margin-top: 36px; }
.hero-text .button { margin-top: 40px; }
.hero-media { grid-column: 7 / span 6; position: relative; margin: 0; }
.hero-main { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
.hero-window {
    position: absolute; width: 30%; left: -15%; top: 12%;
    border: 10px solid var(--ground);
}
.hero-media figcaption { margin-top: 14px; font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Sections ---------- */
.section { padding: var(--section) 0; }
.field-ochre { background: var(--ochre); }
.field-tone { background: var(--tone); }
.field-dark { background: var(--dark); color: var(--on-dark); }
.field-dark .small, .field-dark figcaption { color: var(--on-dark-soft); }
.field-blue { background: var(--blue); color: #fff; }

/* Row: heading in the left third, body in the right two-thirds */
.row-head { grid-column: 1 / span 4; }
.row-body { grid-column: 6 / span 7; }

/* ---------- Facts (ochre field) ---------- */
.facts-head { grid-column: 1 / span 5; }
.facts-list { grid-column: 6 / span 7; display: grid; grid-template-columns: 1fr 1fr; gap: 56px var(--gap); margin: 0; }
.facts-list div { margin: 0; }
.facts-list dt { font: 700 clamp(2.4rem, 4.2vw, 4.4rem)/1 var(--display); letter-spacing: -0.015em; }
.facts-list dd { margin: 12px 0 0; font-size: 1.05rem; max-width: 18em; }

/* ---------- Services ---------- */
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 48px var(--gap); margin: 56px 0 0; }
.services dt { font: 700 1.45rem/1.2 var(--display); margin-bottom: 10px; }
.services dd { margin: 0; color: var(--ink-soft); max-width: 30em; }

/* ---------- Featured project (dark) ---------- */
.feature-text { grid-column: 1 / span 4; align-self: center; }
.feature-text h2 { margin-bottom: 20px; }
.feature-media { grid-column: 6 / span 7; }
.quote { margin: 48px 0; }
.quote p { font: 400 clamp(1.3rem, 1.9vw, 1.75rem)/1.35 var(--text); letter-spacing: -0.01em; max-width: 22em; }
.quote cite { display: block; font: 400 0.95rem/1.4 var(--text); font-style: normal; color: var(--on-dark-soft); }
.field-dark .more { text-decoration-color: var(--ochre); }

.mosaic { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); gap: var(--gap); aspect-ratio: 7 / 5; }
.mosaic a { overflow: hidden; display: block; }
.mosaic a:first-child { grid-row: span 2; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
[data-gallery] a { cursor: zoom-in; }
[data-gallery] a:hover img { transform: scale(1.04); }

/* ---------- Reference split + list ---------- */
.ref-feature { grid-column: 1 / span 6; }
.ref-feature img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 24px; }
.ref-feature h3 { font: 700 clamp(1.6rem, 2.2vw, 2.2rem)/1.1 var(--display); letter-spacing: -0.01em; margin-bottom: 8px; }
.ref-index { grid-column: 8 / span 5; }
.ref-index h2 { margin-bottom: 40px; }
.ref-index ul { list-style: none; margin: 0 0 40px; padding: 0; }
.ref-index li { padding: 16px 0; }
.ref-index li + li { margin-top: 4px; }
.ref-index .name { display: block; font: 700 clamp(1.4rem, 1.9vw, 1.9rem)/1.15 var(--display); letter-spacing: -0.01em; }
.ref-index .where { display: block; color: var(--ink-soft); font-size: 0.98rem; margin-top: 4px; }

/* ---------- CTA (blue) ---------- */
.cta-head { grid-column: 1 / span 7; }
.cta-body { grid-column: 9 / span 4; align-self: end; }
.cta-body p { font-size: 1.15rem; margin-bottom: 32px; }

/* ---------- Page heads ---------- */
.page-head { padding: clamp(48px, 7vw, 112px) 0 clamp(56px, 7vw, 112px); }
.page-head .grid { align-items: end; }
.page-head-text { grid-column: 1 / span 6; }
.page-head-text .lede { margin-top: 32px; }
.page-head-media { grid-column: 8 / span 5; margin: 0; }
.page-head-media img:not(.porthole) { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.page-head--text .page-head-text { grid-column: 1 / span 8; }

/* ---------- About ---------- */
.about-photo { grid-column: 1 / span 5; }
.about-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about-text { grid-column: 7 / span 6; align-self: center; }
.about-text h2 { margin-bottom: 36px; }
.about-text p { max-width: 36em; }

.timeline { grid-column: 6 / span 7; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px var(--gap); }
.timeline-year { display: block; font: 700 clamp(2.2rem, 3.4vw, 3.4rem)/1 var(--display); letter-spacing: -0.03em; margin-bottom: 12px; }
.timeline p { max-width: 22em; margin: 0; }

/* ---------- Reference case studies ---------- */
.case { padding-bottom: 0; }
.case:last-of-type { padding-bottom: var(--section); }
.case-text { grid-column: 1 / span 4; }
.case-text h2 { margin-bottom: 16px; }
.case-text .where { color: var(--ink-soft); margin-bottom: 36px; }
.case-gallery { grid-column: 6 / span 7; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.case-gallery a { display: block; overflow: hidden; aspect-ratio: 4 / 3; }
.case-gallery > a:first-child { grid-column: span 2; aspect-ratio: 16 / 10; }
.case-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.case-more { display: contents; }
.case-more[hidden] { display: none; }
.gallery-all {
    grid-column: 1 / -1; justify-self: start; cursor: pointer;
    background: none; border: 0; padding: 4px 0; color: inherit;
    font: 600 1rem var(--text);
    text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--ochre);
}
.case-caption { grid-column: 1 / -1; font-size: 0.9rem; color: var(--ink-soft); margin: 0; }

.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 24px var(--gap); margin: 0 0 36px; }
.spec dt { font-size: 0.9rem; color: var(--ink-soft); }
.spec dd { margin: 2px 0 0; font-weight: 600; }
.spec a { color: var(--blue); }

.ref-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 64px var(--gap); margin-top: 72px; }
.ref-grid article h3 { font: 700 clamp(1.5rem, 2vw, 2rem)/1.1 var(--display); letter-spacing: -0.01em; margin-bottom: 8px; }
.ref-grid .where { color: var(--ink-soft); font-size: 0.98rem; margin-bottom: 18px; }
.ref-grid p:last-child { max-width: 30em; }

/* ---------- Accolade ---------- */
.award { grid-column: 1 / span 6; }
.award blockquote { margin: 0; }
.award blockquote p { font: 400 clamp(1.35rem, 2vw, 1.85rem)/1.35 var(--text); letter-spacing: -0.01em; max-width: 24em; }
.award cite { font-style: normal; color: var(--ink-soft); }
.award-card { grid-column: 8 / span 5; align-self: start; background: var(--ground); padding: clamp(28px, 3vw, 48px); }
.award-card img { width: 64px; margin-bottom: 28px; }
.award-card dl { margin: 0 0 32px; display: grid; gap: 18px; }
.award-card dt { font-size: 0.9rem; color: var(--ink-soft); }
.award-card dd { margin: 2px 0 0; font-weight: 600; font-size: 1.1rem; }

.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.strip a { display: block; overflow: hidden; aspect-ratio: 1; }
.strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }

/* ---------- News ---------- */
.news-item .row-head time { display: block; margin-top: 16px; color: var(--ink-soft); }
.news-item h2 { font-size: clamp(1.9rem, 3vw, 3rem); }
.news-item .row-body p { max-width: 36em; }

/* ---------- Links ---------- */
.link-list { grid-column: 6 / span 7; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.link-list a {
    display: flex; flex-direction: column; height: 100%;
    padding: 28px 30px 26px; background: var(--tone); text-decoration: none;
    transition: background-color .2s, color .2s;
}
.link-list a:hover { background: var(--ink); color: var(--on-dark); }
.link-list a:hover .link-desc, .link-list a:hover .link-host { color: var(--on-dark-soft); }
.link-title { font: 700 1.6rem/1.1 var(--display); letter-spacing: -0.01em; }
.link-desc { margin: 10px 0 24px; flex: 1; color: var(--ink-soft); }
.link-host { font-size: 0.9rem; color: var(--blue); }

/* ---------- Contact ---------- */
.contact-info { grid-column: 1 / span 5; }
.contact-phone { font: 700 clamp(2.4rem, 4vw, 4rem)/1 var(--display); letter-spacing: -0.03em; text-decoration: none; display: inline-block; margin: 8px 0 36px; }
.contact-phone:hover { color: var(--blue); }
.contact-info address { font-style: normal; font-size: 1.15rem; margin-bottom: 56px; }
.label { display: block; font-size: 0.95rem; color: var(--ink-soft); }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.people li { display: flex; flex-direction: column; }
.person-name { font: 700 1.3rem/1.25 var(--display); }
.people a { text-decoration: none; }
.people a:hover { color: var(--blue); text-decoration: underline; }
.contact-map { grid-column: 7 / span 6; }
.contact-map iframe { display: block; width: 100%; aspect-ratio: 1; border: 0; filter: grayscale(.4); margin-bottom: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark); padding: clamp(80px, 9vw, 140px) 0 32px; }
.footer-logo { width: clamp(200px, 20vw, 280px); margin: 0 0 clamp(56px, 6vw, 96px); }
.footer-cols { row-gap: 40px; }
.footer-cols > div { grid-column: span 3; }
.footer-cols h2 { font: 600 1rem/1.4 var(--text); letter-spacing: 0; margin-bottom: 10px; }
.footer-cols p, .footer-cols address { color: var(--on-dark-soft); font-style: normal; margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--on-dark); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; margin-top: 80px; color: var(--on-dark-soft); font-size: 0.9rem; }

/* ---------- Lightbox (floats, so a scrim is allowed) ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(16, 16, 16, .96); display: none; align-items: center; justify-content: center; }
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: min(92vw, 1100px); max-height: 86vh; width: auto; height: auto; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; cursor: pointer; font: 300 2.8rem/1 var(--text); padding: 16px 22px; opacity: .75; transition: opacity .2s; }
.lightbox button:hover, .lightbox button:focus-visible { opacity: 1; }
.lightbox-close { top: 8px; right: 8px; }
.lightbox-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 8px; top: 50%; transform: translateY(-50%); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
    .js [data-reveal].is-in { opacity: 1; transform: none; }
    .hero-main { animation: settle 2.4s var(--ease) both; }
    .hero-window { animation: rise 1.4s .3s var(--ease) both; }
    @keyframes settle { from { transform: scale(1.06); opacity: 0; } to { transform: none; opacity: 1; } }
    @keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
    .main-nav ul { gap: 22px; }
    .hero-text, .page-head-text, .page-head--text .page-head-text { grid-column: 1 / -1; }
    .hero-media { grid-column: 2 / -1; margin-top: 56px; }
    .page-head-media { grid-column: 1 / -1; margin-top: 48px; }
    .page-head-media .porthole { width: 60%; }
    .row-head, .facts-head, .feature-text, .cta-head, .about-text, .case-text, .contact-info, .award { grid-column: 1 / -1; }
    .row-body, .facts-list, .feature-media, .cta-body, .timeline, .case-gallery, .link-list, .contact-map, .award-card { grid-column: 1 / -1; margin-top: 48px; }
    .ref-feature { grid-column: 1 / span 6; }
    .ref-index { grid-column: 7 / span 6; }
    .about-photo { grid-column: 1 / span 8; margin-bottom: 56px; }
    .feature-text h2 { margin-bottom: 12px; }
    .ref-grid { grid-template-columns: 1fr 1fr; }
    .footer-cols > div { grid-column: span 6; }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
    body { font-size: 17px; }
    .header-inner { height: 68px; }
    .brand-logo { width: 124px; }
    .nav-toggle {
        display: flex; align-items: center; justify-content: center;
        width: 48px; height: 48px; margin-right: -12px;
        background: none; border: 0; cursor: pointer; color: var(--ink);
    }
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
        display: block; width: 24px; height: 2px; background: currentColor; position: relative; transition: transform .25s, background-color .25s;
    }
    .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle-bars::before { top: -7px; }
    .nav-toggle-bars::after { top: 7px; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }
    .main-nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--ground); display: none; padding: 8px var(--margin) 28px; }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .main-nav a { display: block; padding: 14px 0; font: 700 1.8rem/1.1 var(--display); letter-spacing: -0.01em; }
    .main-nav .button { margin-top: 16px; padding: 18px 22px; font: 600 1rem/1 var(--text); text-align: center; letter-spacing: 0; }
    .no-js .main-nav { position: static; display: block; }

    .hero-media { grid-column: 1 / -1; margin-top: 40px; }
    .hero-main { aspect-ratio: 4 / 5; }
    .hero-window { width: 40%; left: auto; right: -4px; top: auto; bottom: -48px; border-width: 8px; }
    .hero-media figcaption { margin-top: 18px; padding-right: 44%; }
    .facts-list, .services, .timeline, .spec { grid-template-columns: 1fr; }
    .facts-list { gap: 36px; }
    .ref-feature, .ref-index { grid-column: 1 / -1; }
    .ref-index { margin-top: 72px; }
    .ref-grid { grid-template-columns: 1fr; gap: 48px; }
    .about-photo { grid-column: 1 / -1; }
    .mosaic { aspect-ratio: 4 / 5; grid-template-columns: 1fr 1fr; grid-template-rows: 1.4fr 1fr; }
    .mosaic a:first-child { grid-row: auto; grid-column: span 2; }
    .mosaic a:nth-child(n+4) { display: none; }
    .strip { grid-template-columns: 1fr 1fr; }
    .link-list { grid-template-columns: 1fr; }
    .footer-cols > div { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; }
}

.page-head-media .porthole { width: 78%; margin-left: auto; }

.row-window { width: min(78%, 340px); margin-top: 56px; }
@media (max-width: 1080px) { .row-window { display: none; } }
