/* Oktoid site styles, shared by the home page and the archive */

/* Registered so the hero's colour can fade from one app to the next */
@property --c { syntax: "<color>"; inherits: true; initial-value: #e3148e; }

:root {
  --bg: #0f0b12;
  --bg-2: #141018;
  --surface: #19131e;
  --surface-2: #211a27;
  --line: #30263a;
  --line-2: #47394f;
  --text: #f7f1f8;
  --muted: #bcb0c6;
  --dim: #85798f;
  --rainbow: #f2542d, #f7b91f, #7fd13b, #4fd2f2, #4a86f0, #a35ff5, #e3148e;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.2, .9, .3, 1.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 8px; }
main { overflow-x: clip; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Header */
.top { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid transparent; transition: background-color .3s, border-color .3s; }
.top.scrolled { background: rgba(15, 11, 18, .74); border-bottom-color: rgba(255, 255, 255, .07);
                -webkit-backdrop-filter: saturate(1.5) blur(18px); backdrop-filter: saturate(1.5) blur(18px); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: .86rem; font-weight: 800; letter-spacing: .16em; text-decoration: none; }
.brand .mark { width: 30px; height: 30px; transition: transform .9s var(--spring); }
.brand:hover .mark { transform: rotate(45deg); }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 600; text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--text); }

/* The octagon mark: eight segments, one per app */
.mark { display: block; overflow: visible; }
.mark .seg { fill: var(--sc); transition: opacity .6s ease, fill .6s ease, transform .7s var(--spring); }
.mark.tiles .seg { opacity: .38; }
.mark.tiles .seg.on { opacity: 1; }
.mark.tiles .gaps { fill: none; stroke: var(--bg); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.mark.lines .seg { fill: rgba(255, 255, 255, .035); }
.mark.lines .seg.t2 { fill: color-mix(in srgb, var(--sc) 16%, transparent); }
.mark.lines .seg.t1 { fill: color-mix(in srgb, var(--sc) 42%, transparent); }
.mark.lines .seg.on { fill: var(--sc); transform: translate(calc(var(--dx) * 5px), calc(var(--dy) * 5px)); }
.mark.lines .spokes, .mark.lines .inner { fill: none; stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mark.lines .inner { fill: var(--bg-2); }
.mark.lines .ring { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1; stroke-dasharray: 2 7; vector-effect: non-scaling-stroke;
                    transform-box: fill-box; transform-origin: center; animation: spin 90s linear infinite; }
.js .orb .seg { animation: seg-in 1s var(--spring) backwards; animation-delay: calc(.3s + var(--k) * 80ms); }
@keyframes seg-in { from { opacity: 0; transform: translate(calc(var(--dx) * -34px), calc(var(--dy) * -34px)); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Hero */
.hero { position: relative; isolation: isolate; padding: 30px 0 120px; transition: --c 1.2s ease; }
.hero::before { content: ""; position: absolute; inset: -68px 0 0; z-index: -2; pointer-events: none;
                background-image: radial-gradient(rgba(255, 255, 255, .075) 1px, transparent 1.5px); background-size: 28px 28px;
                -webkit-mask-image: radial-gradient(ellipse 75% 70% at 70% 35%, #000 20%, transparent 75%);
                        mask-image: radial-gradient(ellipse 75% 70% at 70% 35%, #000 20%, transparent 75%); }
.glow { position: absolute; z-index: -1; top: -280px; right: -220px; width: 880px; height: 880px; border-radius: 50%; pointer-events: none;
        background: var(--c); opacity: .2; animation: drift 16s ease-in-out infinite alternate;
        -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
                mask-image: radial-gradient(closest-side, #000, transparent); }
.glow.b { top: auto; right: auto; bottom: -340px; left: -280px; width: 720px; height: 720px; background: #c405c6; opacity: .1; animation-duration: 23s; }
@keyframes drift { to { transform: translate(-60px, 50px) scale(1.12); } }

.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; align-items: center; gap: 40px; min-height: min(760px, calc(100svh - 68px)); }
.intro > * { animation: rise 1s var(--ease) backwards; }
.intro > :nth-child(2) { animation-delay: .1s; }
.intro > :nth-child(3) { animation-delay: .2s; }
.intro > :nth-child(4) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.eyebrow { margin: 0 0 14px; color: var(--dim); font-size: .78rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.hero .eyebrow { margin-bottom: 22px; color: var(--muted); }
.hero .eyebrow::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 12px; vertical-align: 1px; border-radius: 50%;
                         background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 24%, transparent); }
.nw { white-space: nowrap; }
/* Sized so the hero's longest line, "Small apps that", always fits its column */
h1 { margin: 0; font-size: clamp(2.9rem, 6.2vw, 5.1rem); line-height: .96; font-weight: 900; letter-spacing: -.035em; }
.shine { background: linear-gradient(100deg, var(--c), color-mix(in srgb, var(--c) 50%, #fff) 55%, var(--c));
         -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 26px 0 0; max-width: 31em; color: var(--muted); font-size: clamp(1.08rem, 1.6vw, 1.22rem); }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

.orb-wrap { display: grid; justify-items: center; perspective: 1100px; }
.orb { position: relative; width: min(520px, 100%); aspect-ratio: 1;
       transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease); }
.orb > svg { position: absolute; inset: 0; width: 100%; height: 100%;
             filter: drop-shadow(0 0 26px color-mix(in srgb, var(--c) 38%, transparent)); }
.orb-icon { position: absolute; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; translate: -50% -50%; }
.orb-icon > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; scale: .6; rotate: -10deg;
                transition: opacity .45s ease, scale .7s var(--spring), rotate .7s var(--spring); animation: bob 6s ease-in-out infinite; }
.orb-icon > .on { opacity: 1; scale: 1; rotate: 0deg; }
.orb-icon .ios { border-radius: 22.5%; }
.orb-icon .next { display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, .38); border-radius: 22.5%;
                  color: rgba(255, 255, 255, .8); font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; }
.orb-icon .hello { display: grid; place-items: center; color: var(--muted); font-size: clamp(.6rem, 1.1vw, .78rem); font-weight: 800; letter-spacing: .18em; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.orb-caption { min-height: 6em; margin-top: 4px; text-align: center; }
.orb-caption > * { margin: 0; }
.orb-kind { color: var(--c); font-size: .74rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.orb-name { margin-top: 4px; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.orb-name a { text-decoration: none; }
.orb-name a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.orb-line { margin-top: 2px; color: var(--muted); }
.orb-caption.swap > * { animation: swap .6s var(--ease) backwards; }
.orb-caption.swap > :nth-child(2) { animation-delay: .05s; }
.orb-caption.swap > :nth-child(3) { animation-delay: .1s; }
@keyframes swap { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: .6em 1.05em; border: 1px solid var(--line-2); border-radius: 999px;
       color: var(--text); font-size: .92rem; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap;
       transition: background-color .2s, border-color .2s, box-shadow .3s, transform .25s var(--ease); }
.btn:hover { background: rgba(255, 255, 255, .07); border-color: #6b5a78; }
.btn:active { transform: scale(.97); }
.btn.big { padding: .85em 1.45em; font-size: 1rem; }
.btn.solid { background: #fff; border-color: #fff; color: #120d16; }
.btn.solid:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px color-mix(in srgb, var(--c) 80%, transparent); }
.btn .arr { transition: transform .35s var(--spring); }
.btn:hover .arr { transform: translateX(3px); }

/* Moving band of verbs */
.band { position: relative; left: -3%; width: 106%; margin-top: -40px; padding: 20px 0; overflow: hidden; transform: rotate(-2deg);
        background: var(--bg-2); border-block: 1px solid var(--line); }
.band-track { display: flex; width: max-content; animation: marquee 44s linear infinite; }
.band:hover .band-track { animation-play-state: paused; }
.band-track > span { display: inline-flex; align-items: center; gap: .42em; padding-right: .42em; color: var(--w);
                     font-size: clamp(2.2rem, 5.6vw, 4.4rem); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.band-track > span.o { color: transparent; -webkit-text-stroke: 1.5px var(--w); }
.band-track svg { width: .5em; height: .5em; color: var(--bg-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Sections */
.section { position: relative; padding: 120px 0; }
h2 { margin: 0; font-size: clamp(2.3rem, 5.2vw, 3.9rem); line-height: 1.02; font-weight: 900; letter-spacing: -.03em; }
.section-lead { margin: 20px 0 0; max-width: 34em; color: var(--muted); font-size: 1.15rem; }

/* App cards */
.group { margin-top: 70px; }
.group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.group-head h3 { margin: 0; font-size: .95rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.group-head .count { color: var(--dim); font-weight: 700; font-variant-numeric: tabular-nums; }
.group-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.cards > li { display: flex; }
.app { position: relative; isolation: isolate; display: flex; flex-direction: column; width: 100%; padding: 26px 26px 24px; overflow: hidden;
       border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(180deg, var(--surface-2), var(--surface));
       transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
       transition: transform .45s var(--ease), border-color .3s, box-shadow .45s; }
.app::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
               background: radial-gradient(480px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--ac) 24%, transparent), transparent 62%); }
.app::after { content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 2px; opacity: 0; transition: opacity .35s;
              background: linear-gradient(90deg, transparent, var(--ac), transparent); }
.app:hover, .app:focus-within { --lift: -6px; border-color: color-mix(in srgb, var(--ac) 42%, var(--line));
                                box-shadow: 0 34px 70px -34px color-mix(in srgb, var(--ac) 55%, transparent); }
.app:hover::before, .app:focus-within::before, .app:hover::after, .app:focus-within::after { opacity: 1; }
.app-icon { position: relative; width: 84px; height: 84px; margin-bottom: 22px; }
.app-icon::before { content: ""; position: absolute; inset: 14%; z-index: -1; border-radius: 30%; background: var(--ac); opacity: .35;
                    filter: blur(20px); transition: opacity .35s, transform .5s var(--spring); }
.app:hover .app-icon::before { opacity: .7; transform: scale(1.25); }
.app-icon img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s var(--spring); }
.app-icon img.ios { border-radius: 22.5%; box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .7); }
.app:hover .app-icon img { transform: translateY(-3px) rotate(-4deg) scale(1.05); }
.app h4 { margin: 0; font-size: 1.38rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.app .meta { margin: 7px 0 0; color: var(--ac); font-size: .72rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.app .desc { flex: 1; margin: 12px 0 0; color: var(--muted); }
.app .links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Scroll reveals; without JavaScript everything is simply visible */
.js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

/* About and timeline */
.about { padding-top: 40px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 30px 64px; }
.about-grid p { margin: 0 0 14px; color: var(--muted); font-size: 1.15rem; }
.about-grid p:last-child { margin-bottom: 0; }
.about-grid a { color: var(--text); text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 4px; }
.timeline { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 16px; margin: 80px 0 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 52px; left: 0; right: 0; height: 2px; border-radius: 2px;
                    background: linear-gradient(90deg, var(--rainbow), #fff); transform-origin: left; }
.js .timeline::before { transform: scaleX(0); transition: transform 1.8s cubic-bezier(.65, 0, .25, 1) .2s; }
.js .timeline.in::before { transform: none; }
.tl { position: relative; }
.js .tl { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(.35s + var(--i) * .22s); }
.js .timeline.in .tl { opacity: 1; transform: none; }
.tl::before { content: ""; position: absolute; top: 46px; left: 0; width: 14px; height: 14px; border: 3px solid var(--dot, #fff); border-radius: 50%; background: var(--bg); }
.tl-year { display: block; height: 34px; font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.tl-icons { display: flex; gap: 8px; margin-top: 46px; }
.tl-icons img, .tl-icons svg { width: 46px; height: 46px; object-fit: contain; }
.tl-icons .ios { border-radius: 22.5%; }
.tl-names { margin: 10px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.4; }

/* Footer */
.foot { margin-top: 40px; padding: 46px 0 56px; border-top: 1px solid var(--line); }
.foot-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.foot p { margin: 0; color: var(--dim); }
.foot nav { display: flex; gap: 24px; }
.foot nav a { color: var(--muted); font-weight: 600; text-decoration: none; }
.foot nav a:hover { color: var(--text); }
.foot .brand svg { width: 26px; height: 26px; color: var(--bg); }

/* Archive */
.page-head { position: relative; isolation: isolate; padding: 80px 0 10px; }
.page-head h1 { font-size: clamp(2.8rem, 6vw, 4.8rem); }
.page-head .lead { max-width: 34em; }
.page-head .glow { top: -420px; right: -260px; background: #4a86f0; opacity: .14; }
.page-head + .section { padding-top: 0; }
.old-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin: 56px 0 0; padding: 0; list-style: none; }
.old { display: grid; grid-template-columns: 64px 1fr; align-items: start; gap: 18px; height: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 22px;
       background: var(--surface); transition: border-color .3s, transform .45s var(--ease); }
.old:hover { border-color: var(--line-2); transform: translateY(-3px); }
.old img { width: 64px; height: 64px; object-fit: contain; opacity: .75; filter: grayscale(1) brightness(.85);
           transition: filter .5s, opacity .5s, transform .6s var(--spring); }
.old:hover img { opacity: 1; filter: none; transform: rotate(-4deg) scale(1.05); }
.old h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; }
.old .tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 999px; vertical-align: 2px;
            color: var(--dim); font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.old p { margin: 6px 0 0; color: var(--muted); font-size: .96rem; }
.old .credit { margin-top: 10px; color: var(--dim); font-size: .82rem; }
.back { margin-top: 56px; }

@media (max-width: 960px) {
  .hero { padding-bottom: 100px; }
  .hero-grid { grid-template-columns: 1fr; gap: 16px; min-height: 0; padding-top: 18px; }
  h1 { font-size: clamp(2.3rem, 12.4vw, 5.1rem); }
  .orb { width: min(420px, 90vw); }
  .about-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 28px; padding-left: 36px; }
  .timeline::before { top: 8px; bottom: 8px; left: 6px; right: auto; width: 2px; height: auto;
                      background: linear-gradient(180deg, var(--rainbow), #fff); transform-origin: top; }
  .js .timeline::before { transform: scaleY(0); }
  .tl::before { top: 6px; left: -36px; }
  .tl-year { height: auto; }
  .tl-icons { margin-top: 12px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .nav-links { gap: 20px; }
  .nav-links a { font-size: .9rem; }
  .section { padding: 90px 0; }
  .band { margin-top: -30px; padding: 14px 0; }
  .app { padding: 22px 22px 20px; }
  .old-grid { grid-template-columns: 1fr; }
}
@media (max-width: 340px) {
  .nav-links a[href$="#about"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
                           transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .tl { opacity: 1; transform: none; }
  .js .timeline::before { transform: none; }
}
