/* =========================================================
   RADL HOLDING SVERIGE AB - Main Homepage Styles
   File: /assets/style.css
   ========================================================= */

/* =========================
   1) Design Tokens
========================= */
:root {
    --bg-main: #f7f9f5;
    --bg-soft: #ffffff;
    --bg-alt: #eef3eb;

    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.94);

    --text-main: #122037;
    --text-soft: #405165;
    --text-muted: #667687;

    --line-soft: rgba(24, 40, 62, 0.14);
    --line-strong: rgba(24, 40, 62, 0.24);

    --accent-blue: #3f61d8;
    --accent-gold: #ba8a4a;
    --accent-cyan: #2ea0cc;

    --shadow-soft: 0 16px 34px rgba(24, 40, 62, 0.1);
    --shadow-md: 0 24px 48px rgba(24, 40, 62, 0.14);

    --radius-lg: 1.2rem;
    --radius-md: 0.95rem;
    --radius-sm: 0.72rem;

    --container: min(1180px, calc(100% - 3rem));
    --header-offset: 86px;
}

/* =========================
   2) Reset / Base
========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 6% -8%, rgba(63, 97, 216, 0.16), transparent 34%),
        radial-gradient(circle at 90% -12%, rgba(186, 138, 74, 0.16), transparent 36%),
        linear-gradient(180deg, #f8faf6 0%, #eef2ec 44%, #fafcf8 100%);
    line-height: 1.64;
    overflow-x: hidden;
}

body.menu-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a,
button {
    color: inherit;
}

button {
    font: inherit;
    border: 0;
    background: none;
    cursor: pointer;
}

h1,
h2,
h3,
p,
ul {
    margin: 0;
}

ul {
    list-style: none;
    padding: 0;
}

.container {
    width: var(--container);
    margin-inline: auto;
    position: relative;
    z-index: 3;
}

.section {
    position: relative;
    padding: clamp(3.55rem, 7.3vw, 5.3rem) 0;
    scroll-margin-top: calc(var(--header-offset) + 12px);
}

.section:not(.hero)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 92%);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(24, 40, 62, 0.22), transparent);
}

/* =========================
   3) Ambient Background + Progress
========================= */
.page-ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.42;
}

.orb-a {
    width: 320px;
    height: 320px;
    left: -120px;
    top: -120px;
    background: radial-gradient(circle, rgba(63, 97, 216, 0.6), transparent 72%);
    animation: float-a 16s ease-in-out infinite;
}

.orb-b {
    width: 340px;
    height: 340px;
    right: -120px;
    top: -130px;
    background: radial-gradient(circle, rgba(46, 160, 204, 0.56), transparent 72%);
    animation: float-b 18s ease-in-out infinite;
}

.orb-c {
    width: 290px;
    height: 290px;
    left: 42%;
    bottom: -130px;
    background: radial-gradient(circle, rgba(186, 138, 74, 0.52), transparent 72%);
    animation: pulse 11s ease-in-out infinite;
}

.ambient-grid {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image:
        linear-gradient(rgba(28, 44, 66, 0.22) 1px, transparent 1px),
        linear-gradient(90deg, rgba(28, 44, 66, 0.22) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(circle at 50% 34%, black 34%, transparent 76%);
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1200;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.1);
}

.scroll-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue), var(--accent-cyan));
    box-shadow: 0 0 14px rgba(63, 97, 216, 0.42);
}

/* =========================
   4) Header / Navigation
========================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-top: 0.78rem;
}

.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    border: 1px solid transparent;
    border-radius: 1rem;
    padding: 0.66rem 0.86rem;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.is-scrolled .nav-shell {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--line-soft);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    border-radius: 0.72rem;
    padding: 0.28rem 0.36rem;
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand span {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    color: var(--text-main);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 0.24rem;
}

.nav-link {
    position: relative;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.48rem 0.78rem;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0.66rem;
    right: 0.66rem;
    bottom: 0.16rem;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
    color: var(--text-main);
    background: rgba(24, 40, 62, 0.08);
    outline: none;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.is-active::after {
    transform: scaleX(1);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 0.72rem;
    background: rgba(255, 255, 255, 0.9);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.28rem;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-main);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* =========================
   5) Buttons + Micro Motion
========================= */
.btn,
.card-link,
.contact-card {
    --mx: 0px;
    --my: 0px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.74rem 1.16rem;
    transform: translate3d(var(--mx), var(--my), 0);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translate3d(var(--mx), calc(var(--my) - 2px), 0);
    outline: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(110deg, #4363de, #3253c8);
    box-shadow: 0 12px 26px rgba(67, 99, 222, 0.24);
}

.btn-secondary {
    color: var(--text-main);
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.84);
}

.nav-cta {
    margin-left: 0.48rem;
}

/* =========================
   6) Hero
========================= */
.hero {
    padding-top: clamp(5.2rem, 10vw, 7.4rem);
}

.hero-brand-center {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    margin-bottom: clamp(1.2rem, 3vw, 2.2rem);
}

.hero-brand-center::after {
    content: "";
    position: absolute;
    width: min(507px, 96%);
    height: 96px;
    bottom: -22px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(63, 97, 216, 0.24), rgba(186, 138, 74, 0.18) 42%, transparent 72%);
    filter: blur(26px);
    z-index: -1;
}

.hero-logo-center {
    width: min(500px, 100%);
    max-height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 12px 24px rgba(24, 40, 62, 0.13));
    animation: logo-float 8.8s ease-in-out infinite;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 0.92fr;
    gap: 0.98rem;
    align-items: start;
}

.eyebrow,
.section-label {
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 700;
}

.hero-copy h1 {
    font-size: clamp(2.05rem, 4.8vw, 3.62rem);
    line-height: 1.08;
    margin: 0.44rem 0 0.72rem;
}

.hero-copy p {
    color: var(--text-soft);
    max-width: 64ch;
}

.hero-copy p + p {
    margin-top: 0.72rem;
}

.hero-focus {
    color: var(--text-main) !important;
    margin-top: 0.78rem !important;
    font-size: 1.03rem;
}

.hero-actions {
    margin-top: 1.08rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.78rem;
}

.hero-panel {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: 1.38rem;
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.hero-panel:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(63, 97, 216, 0.25);
}

.hero-panel h2 {
    font-size: clamp(1.24rem, 2.5vw, 1.7rem);
    line-height: 1.25;
    margin-bottom: 0.48rem;
}

.hero-panel > p {
    color: var(--text-soft);
}

.quick-links {
    margin-top: 0.86rem;
    display: grid;
    gap: 0.5rem;
}

.quick-links a {
    text-decoration: none;
    color: var(--text-soft);
    border: 1px solid var(--line-soft);
    border-radius: 0.82rem;
    background: var(--surface-strong);
    padding: 0.68rem 0.84rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.quick-links a:hover,
.quick-links a:focus-visible {
    transform: translateX(4px);
    border-color: rgba(63, 97, 216, 0.35);
    outline: none;
}

/* =========================
   7) Shared Section Styling
========================= */
.section-head {
    max-width: 820px;
    margin-bottom: 1.15rem;
}

.section-head h2 {
    font-size: clamp(1.44rem, 3.1vw, 2.32rem);
    line-height: 1.2;
    margin: 0.62rem 0 0.72rem;
}

.section-head p {
    color: var(--text-soft);
}

.content-card,
.project-card,
.tool-card,
.founder-shell,
.contact-shell {
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.content-card:hover,
.founder-shell:hover,
.contact-shell:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(63, 97, 216, 0.24);
}

.content-card {
    padding: 1.56rem;
}

.content-card p {
    color: var(--text-soft);
}

.content-card p + p {
    margin-top: 0.88rem;
}

.philosophy {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0));
}

.steps-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.56rem;
}

.steps-list li {
    position: relative;
    padding-left: 1rem;
    color: #42566f;
    font-weight: 600;
}

.steps-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.58rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-blue);
}

/* =========================
   8) Projects
========================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.84rem;
}

.project-card {
    padding: 1.3rem;
    display: grid;
    align-content: start;
    gap: 0.72rem;
}

.project-card:hover,
.project-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.project-logo {
    min-height: 112px;
    border: 1px solid var(--line-soft);
    border-radius: 0.9rem;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.project-logo img {
    max-width: 198px;
    max-height: 86px;
    object-fit: contain;
}

.project-card h3 {
    font-size: 1.08rem;
}

.project-card p {
    color: var(--text-soft);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    transform: translate3d(var(--mx), var(--my), 0);
    transition: transform 0.2s ease, color 0.2s ease;
}

.card-link::after {
    content: "→";
    transition: transform 0.2s ease;
}

.card-link:hover,
.card-link:focus-visible {
    color: var(--accent-blue);
    transform: translate3d(var(--mx), calc(var(--my) - 1px), 0);
    outline: none;
}

.card-link:hover::after,
.card-link:focus-visible::after {
    transform: translateX(3px);
}

.section-note {
    margin-top: 0.92rem;
    color: var(--text-soft);
    max-width: 86ch;
}

/* =========================
   9) Tools / Lab
========================= */
.tools-lab {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.44), rgba(255, 255, 255, 0));
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.84rem;
}

.tool-card {
    padding: 1.3rem;
    display: grid;
    align-content: start;
    gap: 0.62rem;
}

.tool-card:hover,
.tool-card:focus-within {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.tool-icon {
    width: 68px;
    height: 68px;
    border-radius: 0.88rem;
    border: 1px solid var(--line-soft);
    background: #fff;
    display: grid;
    place-items: center;
}

.tool-icon img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.tool-card p {
    color: var(--text-soft);
}

/* =========================
   10) Collaboration
========================= */
.bullet-list {
    margin-top: 1rem;
    margin-bottom: 1.08rem;
    display: grid;
    gap: 0.46rem;
}

.bullet-list li {
    position: relative;
    padding-left: 1.04rem;
    color: #40566f;
    text-transform: lowercase;
}

.bullet-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-gold);
    font-weight: 700;
}

/* =========================
   11) Founder
========================= */
.founder-shell {
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 1.2rem;
    align-items: start;
}

.founder-icon {
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    border: 1px solid var(--line-soft);
    background: #fff;
    display: grid;
    place-items: center;
}

.founder-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.founder-shell h2 {
    margin: 0.48rem 0 0.52rem;
    font-size: clamp(1.34rem, 2.8vw, 2rem);
}

.founder-shell p {
    color: var(--text-soft);
}

.founder-shell p + p {
    margin-top: 0.78rem;
}

/* =========================
   12) Contact
========================= */
.contact-shell {
    padding: 1.5rem;
}

.section-head.compact {
    margin-bottom: 1.08rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.74rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    text-decoration: none;
    border: 1px solid var(--line-soft);
    border-radius: 0.88rem;
    background: var(--surface-strong);
    padding: 0.96rem 1.02rem;
    transform: translate3d(var(--mx), var(--my), 0);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
    transform: translate3d(var(--mx), calc(var(--my) - 2px), 0);
    border-color: rgba(63, 97, 216, 0.34);
    outline: none;
}

.contact-card img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.contact-card span {
    display: grid;
    gap: 0.08rem;
}

.contact-card strong {
    font-size: 0.94rem;
    color: var(--text-main);
}

.contact-card small {
    color: var(--text-muted);
    font-size: 0.8rem;
    line-break: anywhere;
}

/* =========================
   13) Footer
========================= */
.site-footer {
    margin-top: clamp(1.5rem, 4.6vw, 3rem);
    padding: 2.15rem 0 2.3rem;
    border-top: 1px solid var(--line-soft);
    background: linear-gradient(180deg, rgba(245, 249, 243, 0.94), rgba(252, 253, 250, 0.98));
}

.footer-shell {
    text-align: center;
    display: grid;
    justify-items: center;
    gap: 0.26rem;
}

.footer-shell > img {
    width: min(320px, 100%);
    margin-bottom: 0.38rem;
}

.footer-shell > p {
    color: var(--text-soft);
}

.footer-shell > p:first-of-type {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.footer-links {
    margin: 0.85rem 0 0.35rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem 0.9rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--accent-blue);
    outline: none;
}

.copyright {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

/* =========================
   14) Reveal Animation
========================= */
.reveal {
    opacity: 0;
    transform: translateY(24px) scale(0.99);
    transition:
        opacity 0.68s cubic-bezier(0.22, 0.61, 0.36, 1),
        transform 0.68s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: var(--d, 0ms);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* =========================
   15) Keyframes
========================= */
@keyframes float-a {
    0%,
    100% { transform: translate(0, 0); }
    50% { transform: translate(14px, -12px); }
}

@keyframes float-b {
    0%,
    100% { transform: translate(0, 0); }
    50% { transform: translate(-14px, 12px); }
}

@keyframes pulse {
    0%,
    100% { opacity: 0.36; transform: scale(1); }
    50% { opacity: 0.52; transform: scale(1.1); }
}

@keyframes logo-float {
    0%,
    100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* =========================
   16) Responsive
========================= */
@media (max-width: 1100px) {
    .hero-grid,
    .founder-shell {
        grid-template-columns: 1fr;
    }

    .hero-logo-center {
        width: min(460px, 100%);
        max-height: 132px;
    }

    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .founder-icon {
        width: 68px;
        height: 68px;
    }
}

@media (max-width: 980px) {
    :root {
        --header-offset: 72px;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .main-nav {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        border: 1px solid var(--line-soft);
        border-radius: 0.92rem;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: var(--shadow-soft);

        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.84rem;

        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        max-height: 0;
        overflow: hidden;
        transition: opacity 0.24s ease, transform 0.24s ease, max-height 0.24s ease;
    }

    .main-nav.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
        max-height: 84vh;
    }

    .nav-link {
        width: 100%;
        text-align: left;
        border-radius: 0.72rem;
    }

    .nav-cta {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 760px) {
    :root {
        --container: min(1180px, calc(100% - 2.2rem));
    }

    .site-header {
        padding-top: 0.54rem;
    }

    .nav-shell {
        padding: 0.44rem 0.54rem;
    }

    .brand span {
        display: none;
    }

    .hero-logo-center {
        width: min(350px, 100%);
        max-height: 102px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .content-card,
    .project-card,
    .tool-card,
    .founder-shell,
    .contact-shell,
    .hero-panel {
        padding: 1.2rem;
    }

    .contact-card {
        padding: 0.88rem 0.92rem;
    }

    .project-grid,
    .tools-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
