:root {
    --page-background: #08111d;
    --header-background: rgba(8, 17, 29, 0.9);
    --text-primary: #f4f7fb;
    --text-secondary: #aeb9c9;
    --text-faint: #7f8b9d;
    --line-color: rgba(176, 194, 216, 0.19);
    --accent-blue: #159bff;
    --accent-cyan: #24d6e5;
    --surface-color: rgba(255, 255, 255, 0.025);
    --portfolio-divider: rgba(173, 192, 215, 0.18);
    --max-width: 1440px;
}

html[data-theme="light"] {
    --page-background: #f8f9fb;
    --header-background: rgba(248, 249, 251, 0.92);
    --text-primary: #071831;
    --text-secondary: #5f6c7e;
    --text-faint: #8994a3;
    --line-color: rgba(14, 41, 75, 0.14);
    --accent-blue: #087fe8;
    --accent-cyan: #15b9ce;
    --surface-color: rgba(7, 31, 64, 0.018);
    --portfolio-divider: rgba(14, 41, 75, 0.13);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--page-background);
    color: var(--text-primary);
    font-family:
        Inter,
        "Segoe UI",
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.5;
    transition:
        background-color 180ms ease,
        color 180ms ease;
}

img,
svg {
    display: block;
    max-width: 100%;
}

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

button {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line-color);
    background: var(--header-background);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.header-inner {
    width: min(var(--max-width), calc(100% - 48px));
    min-height: 72px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 38px;
}

.header-brand {
    justify-self: start;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.header-brand span {
    color: var(--accent-blue);
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.desktop-nav a {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color 150ms ease;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
    color: var(--accent-blue);
}

.theme-toggle {
    position: relative;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line-color);
    border-radius: 50%;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition:
        border-color 150ms ease,
        background-color 150ms ease;
}

.theme-toggle:hover {
    border-color: var(--accent-blue);
    background: var(--surface-color);
}

.theme-icon {
    position: absolute;
    inset: 10px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition:
        opacity 180ms ease,
        transform 180ms ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.moon-icon {
    opacity: 0;
    transform: rotate(-25deg) scale(0.7);
}

html[data-theme="light"] .sun-icon {
    opacity: 0;
    transform: rotate(25deg) scale(0.7);
}

html[data-theme="light"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.identity-section {
    min-height: calc(100svh - 72px);
    display: grid;
    place-items: center;
    padding: clamp(60px, 9vw, 130px) 24px;
}

.identity-inner {
    width: min(960px, 100%);
    margin: 0 auto;
}

.primary-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.section-inner {
    width: min(var(--max-width), calc(100% - 64px));
    margin: 0 auto;
}

.compact-section {
    width: min(980px, calc(100% - 64px));
    text-align: center;
}

.company-section {
    padding: 20px 0 clamp(95px, 11vw, 150px);
}

.section-rule {
    width: 100%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--line-color) 16%,
        var(--line-color) 84%,
        transparent
    );
}

.bottom-rule {
    margin-top: 56px;
}

.section-kicker {
    margin: 50px 0 28px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.company-summary {
    max-width: 820px;
    margin: 0 auto;
    color: var(--text-primary);
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    font-weight: 350;
    line-height: 1.8;
}

.secondary-summary {
    max-width: 760px;
    margin-top: 22px;
    color: var(--text-secondary);
    font-size: clamp(0.94rem, 1.4vw, 1.06rem);
}

.portfolio-section {
    padding: clamp(92px, 10vw, 150px) 0;
    background: var(--surface-color);
}

.portfolio-heading {
    display: grid;
    grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);
    align-items: center;
    gap: 28px;
    margin-bottom: clamp(60px, 7vw, 92px);
}

.portfolio-heading span {
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--line-color)
    );
}

.portfolio-heading span:last-child {
    background: linear-gradient(
        90deg,
        var(--line-color),
        transparent
    );
}

.portfolio-heading p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-align: center;
    text-transform: uppercase;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: start;
}

.portfolio-company {
    position: relative;
    min-width: 0;
    padding: 0 22px;
    text-align: center;
}

.portfolio-company + .portfolio-company::before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 4px;
    left: 0;
    width: 1px;
    background: linear-gradient(
        180deg,
        transparent,
        var(--portfolio-divider) 20%,
        var(--portfolio-divider) 82%,
        transparent
    );
}

.company-mark {
    width: 76px;
    height: 76px;
    margin: 0 auto 23px;
    display: grid;
    place-items: center;
}

.company-mark svg {
    width: 58px;
    height: 58px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portfolio-name {
    margin: 0 0 7px;
    color: var(--text-primary);
    font-size: clamp(0.92rem, 1.25vw, 1.28rem);
    font-weight: 550;
    line-height: 1.15;
}

.portfolio-name span {
    color: var(--accent-cyan);
}

.portfolio-category {
    margin: 0;
    color: var(--text-faint);
    font-size: clamp(0.52rem, 0.7vw, 0.65rem);
    font-weight: 650;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
}

.company-mark-flowmiso {
    position: relative;
    color: #15c9ec;
}

.flow-line {
    position: absolute;
    left: 8px;
    width: 56px;
    height: 7px;
    border-top: 4px solid currentColor;
    border-radius: 100%;
    transform: skewX(-24deg);
}

.flow-line::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-top: 4px solid currentColor;
    border-right: 4px solid currentColor;
    transform: rotate(34deg);
}

.flow-line-one {
    top: 17px;
}

.flow-line-two {
    top: 34px;
    left: 4px;
    opacity: 0.82;
}

.flow-line-three {
    top: 51px;
    left: 12px;
    opacity: 0.58;
}

.company-mark-security {
    color: #27d6ce;
}

.company-mark-mapping {
    color: #8bcf31;
}

.company-mark-music {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #b15cff;
}

.company-mark-music span {
    width: 4px;
    border-radius: 999px;
    background: currentColor;
}

.company-mark-music span:nth-child(1),
.company-mark-music span:nth-child(7) {
    height: 18px;
}

.company-mark-music span:nth-child(2),
.company-mark-music span:nth-child(6) {
    height: 33px;
}

.company-mark-music span:nth-child(3),
.company-mark-music span:nth-child(5) {
    height: 49px;
}

.company-mark-music span:nth-child(4) {
    height: 64px;
}

.company-mark-community {
    color: #3b9fff;
}

.company-mark-marketplace {
    color: #ff7d16;
}

.company-mark-games {
    color: #8c65ef;
}

.portfolio-statement {
    margin: clamp(70px, 8vw, 105px) 0 0;
    color: var(--accent-blue);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.22em;
    text-align: center;
    text-transform: uppercase;
}

.contact-section {
    padding: clamp(90px, 10vw, 140px) 0;
}

.contact-email {
    display: inline-block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: clamp(1.35rem, 3vw, 2.3rem);
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 150ms ease;
}

.contact-email:hover,
.contact-email:focus-visible {
    color: var(--accent-blue);
}

.site-footer {
    padding: 28px 24px 36px;
    color: var(--text-faint);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}

.site-footer p {
    margin: 0;
}

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 4px;
}

@media (max-width: 1180px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: 70px;
    }

    .portfolio-company:nth-child(5)::before {
        display: none;
    }
}

@media (max-width: 760px) {
    .header-inner {
        width: min(100% - 28px, var(--max-width));
        min-height: 64px;
        grid-template-columns: 1fr auto;
    }

    .desktop-nav {
        display: none;
    }

    .identity-section {
        min-height: auto;
        padding: 72px 18px 76px;
    }

    .identity-inner {
        width: min(100%, 680px);
    }

    .section-inner,
    .compact-section {
        width: min(100% - 32px, var(--max-width));
    }

    .company-section {
        padding-bottom: 90px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 64px;
    }

    .portfolio-company {
        padding: 0 18px;
    }

    .portfolio-company:nth-child(odd)::before {
        display: none;
    }

    .portfolio-company:nth-child(even)::before {
        display: block;
    }

    .portfolio-heading {
        grid-template-columns: minmax(20px, 1fr) auto minmax(20px, 1fr);
        gap: 16px;
    }

    .portfolio-heading p {
        font-size: 0.65rem;
        letter-spacing: 0.14em;
    }
}

@media (max-width: 420px) {
    .header-brand {
        font-size: 0.78rem;
    }

    .identity-section {
        padding-top: 52px;
    }

    .company-summary {
        font-size: 1.04rem;
    }

    .portfolio-company {
        padding: 0 12px;
    }

    .company-mark {
        width: 62px;
        height: 62px;
    }

    .company-mark svg {
        width: 49px;
        height: 49px;
    }

    .portfolio-name {
        font-size: 0.9rem;
    }

    .portfolio-category {
        font-size: 0.5rem;
    }

    .portfolio-statement {
        font-size: 0.64rem;
        letter-spacing: 0.15em;
    }
}

@media (max-height: 560px) and (orientation: landscape) {
    .identity-section {
        min-height: auto;
        padding: 48px 24px 58px;
    }

    .identity-inner {
        width: min(680px, 72vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
