/* ==========================================================================
   ORCA HOLDING — the pod as a solar system
   Orca Holding is the sun at the centre of a black-and-white galaxy.
   Its companies orbit it together, like a pod swimming in formation.
   ========================================================================== */

:root {
    --abyss: #000000;
    --foam: #ffffff;
    --spray: #b9bfc4;       /* secondary text on black */
    --depth: #5b6268;       /* secondary text on white / faint text on black */
    --rule: rgba(255, 255, 255, .14);

    --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --pad: clamp(1.25rem, 3vw, 2.75rem);
    --radius: 12px;         /* the rounded-square O in the ORCA wordmark */
    --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    background: var(--abyss);
    color: var(--foam);
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 4px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Space
   -------------------------------------------------------------------------- */
.space {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
}
.galaxy {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
}
.grain {
    position: absolute; inset: -50%;
    z-index: 1;
    pointer-events: none;
    opacity: .045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
    animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
    0% { transform: translate(0, 0); }
    20% { transform: translate(-3%, 2%); }
    40% { transform: translate(2%, -3%); }
    60% { transform: translate(-2%, -1%); }
    80% { transform: translate(3%, 3%); }
    100% { transform: translate(0, 0); }
}

/* --------------------------------------------------------------------------
   The sun: Orca Holding
   -------------------------------------------------------------------------- */
.sun {
    position: absolute;
    left: 50%; top: 50%;
    z-index: 20;
    width: min(400px, 28vw);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.sun img {
    width: 100%; height: auto;
    filter: drop-shadow(0 0 24px #000) drop-shadow(0 0 60px rgba(0, 0, 0, .9));
}

/* --------------------------------------------------------------------------
   The companies (positioned by galaxy.js; the fallback below is for no-JavaScript)
   -------------------------------------------------------------------------- */
.planet {
    position: absolute;
    left: 0; top: 0;
    width: 0; height: 0;
    z-index: 10;
    outline: none;
    --s: 1;          /* scale from depth  (set by JS) */
    --o: 1;          /* opacity from depth (set by JS) */
    --dim: 1;
}
.planet__body {
    position: absolute;
    left: 0; top: 0;
    padding: 10px;                                   /* a little extra room to hover */
    transform: translate(-50%, -50%) scale(var(--s));
    opacity: calc(var(--o) * var(--dim));
    cursor: pointer;
    transition: opacity .5s var(--ease);
}
.planet__logo {
    display: block;
    height: auto;
    max-width: none;
    /* a dark halo keeps the logo readable over the stars */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, .95)) drop-shadow(0 0 22px rgba(0, 0, 0, .8));
    transition: transform .4s var(--ease), filter .5s var(--ease);
}

/* No JavaScript: the companies simply sit around the sun */
html:not(.js) .planet--0 { left: 24%; top: 30%; }
html:not(.js) .planet--1 { left: 76%; top: 30%; }
html:not(.js) .planet--2 { left: 24%; top: 70%; }
html:not(.js) .planet--3 { left: 76%; top: 70%; }
html:not(.js) .planet--4 { left: 50%; top: 82%; }

/* the sun's pulse passes a company: its logo catches the light */
.planet.is-lit .planet__logo { animation: glint 1.3s var(--ease); }
@keyframes glint {
    0%   { filter: drop-shadow(0 0 10px rgba(255, 255, 255, .9)) drop-shadow(0 0 28px rgba(255, 255, 255, .55)); }
    100% { filter: drop-shadow(0 0 10px rgba(0, 0, 0, .95)) drop-shadow(0 0 22px rgba(0, 0, 0, .8)); }
}

/* hover / focus */
.planet:focus-visible .planet__body { outline: 2px solid var(--foam); outline-offset: 4px; border-radius: 10px; }
.planet.is-active .planet__logo {
    transform: scale(1.06);
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, .95)) drop-shadow(0 0 26px rgba(255, 255, 255, .28));
}
.space.has-active .planet:not(.is-active) { --dim: .25; }
.sun { transition: opacity .5s; }
.space.has-active .sun { opacity: .45; }

/* --------------------------------------------------------------------------
   Info card (opens next to the planet)
   -------------------------------------------------------------------------- */
.card {
    position: absolute;
    top: 0;
    width: 270px;
    padding: 1.25rem 1.35rem 1.35rem;
    border-radius: 18px;
    background: var(--foam);
    color: var(--abyss);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%) scale(.96);
    transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s .3s;
    z-index: 5;
}
.card--right { left: var(--reach, 120px); transform-origin: left center; }
.card--left  { right: var(--reach, 120px); transform-origin: right center; }
/* a line from the planet to its card */
.card::before {
    content: "";
    position: absolute; top: 50%;
    width: 18px; height: 1px;
    background: var(--foam);
}
.card--right::before { right: 100%; }
.card--left::before  { left: 100%; }

.planet.is-active .card {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%);
    transition: opacity .3s var(--ease), transform .4s var(--ease), visibility 0s;
}
.card__name { font-size: 1.15rem; font-weight: 700; font-stretch: 118%; line-height: 1.2; }
.card__kind { margin-top: .15rem; font-size: .82rem; color: var(--depth); }
.card__text { margin-top: .75rem; font-size: .92rem; line-height: 1.5; }
.card__link, .card__soon { display: inline-flex; margin-top: 1rem; font-size: .85rem; font-weight: 600; }
.card__link {
    align-items: center;
    min-height: 42px;
    padding: .55rem 1.05rem;
    border-radius: var(--radius);
    background: var(--abyss);
    color: var(--foam);
    text-decoration: none;
    transition: transform .2s var(--ease);
}
.card__link:hover { transform: translateY(-2px); }
.card__soon { color: var(--depth); font-weight: 500; }

/* --------------------------------------------------------------------------
   HUD: the four corners
   -------------------------------------------------------------------------- */
.hud { position: absolute; z-index: 30; }
.hud--tl { top: var(--pad); left: var(--pad); max-width: 22rem; }
.hud--tr { top: var(--pad); right: var(--pad); }
.hud--bl { bottom: var(--pad); left: var(--pad); display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; }
.hud--br { bottom: var(--pad); right: var(--pad); display: grid; justify-items: end; gap: .2rem; font-size: .78rem; color: var(--depth); }

.hud__tagline {
    font-stretch: 125%;
    font-weight: 250;
    font-size: clamp(1.35rem, .9rem + 1.2vw, 2.1rem);
    line-height: 1.08;
    letter-spacing: -.02em;
    max-width: 14ch;
}
.hud__desc { margin-top: .8rem; max-width: 30ch; font-size: .9rem; color: var(--spray); }

.legend ul { display: grid; justify-items: end; gap: .15rem; }
.legend button {
    padding: .3rem 0;
    font-size: .9rem;
    font-weight: 500;
    font-stretch: 112%;
    color: var(--spray);
    transition: color .2s;
}
.legend button:hover, .legend button.is-active { color: var(--foam); }
.legend button.is-active { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }

.hud__email {
    font-weight: 600;
    font-stretch: 112%;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
    text-decoration-color: var(--depth);
    transition: text-decoration-color .2s;
}
.hud__email:hover { text-decoration-color: var(--foam); }
.social { display: flex; gap: .35rem; }
.social a {
    display: grid; place-items: center;
    width: 38px; height: 38px;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    color: var(--spray);
    background: rgba(0, 0, 0, .4);
    transition: color .2s, border-color .2s, background-color .2s;
}
.social a:hover { color: var(--abyss); background: var(--foam); border-color: var(--foam); }

/* --------------------------------------------------------------------------
   Opening: the sun appears, then the galaxy and planets fade up
   -------------------------------------------------------------------------- */
.js .sun img { opacity: 0; filter: blur(18px); transform: scale(.94); }
.js .planet { opacity: 0; }
.js .hud { opacity: 0; transform: translateY(8px); }
.js .is-ready .sun img {
    opacity: 1;
    filter: drop-shadow(0 0 24px #000) drop-shadow(0 0 60px rgba(0, 0, 0, .9));
    transform: none;
    transition: opacity 1.4s var(--ease), filter 1.4s var(--ease), transform 1.6s var(--ease);
}
.js .is-ready .planet { opacity: 1; transition: opacity 1.4s var(--ease) calc(.6s + var(--delay, 0s)); }
.js .is-ready .hud { opacity: 1; transform: none; transition: opacity 1s var(--ease) .9s, transform 1s var(--ease) .9s; }
.planet--0 { --delay: 0s; }
.planet--1 { --delay: .15s; }
.planet--2 { --delay: .3s; }
.planet--3 { --delay: .45s; }
.planet--4 { --delay: .6s; }

/* --------------------------------------------------------------------------
   Phones and portrait tablets (galaxy.js uses the same rule)
   -------------------------------------------------------------------------- */
@media (max-width: 700px), (max-aspect-ratio: 5/6) {
    .sun { width: min(170px, 44vw); }
    .legend, .hud__hint { display: none; }
    .hud--tl { right: var(--pad); max-width: none; }
    .hud__tagline { font-size: 1.3rem; max-width: none; }
    .hud__desc { margin-top: .4rem; font-size: .8rem; }
    .hud--bl { bottom: calc(var(--pad) + 1.4rem); }
    .hud--br { left: var(--pad); right: auto; justify-items: start; }
    /* card opens above or below the planet instead of beside it */
    .card { width: min(280px, calc(100vw - 2rem)); left: var(--shift, -140px); right: auto; }
    .card--below { top: var(--reach-y, 40px); transform: scale(.96); transform-origin: top center; }
    .card--above { top: auto; bottom: var(--reach-y, 40px); transform: scale(.96); transform-origin: bottom center; }
    .planet.is-active .card--below,
    .planet.is-active .card--above { transform: none; }
    .card::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .grain { animation: none; }
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
