/* digitalblue.ai — shared styles. Palette: black, white, gray-blue. */
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #0b0d11;
  --muted: #566273;
  --line: #dde2e8;
  --accent: #3d638d;
  --accent-soft: #e4ebf3;
  --disc: #6d91ba;
  --dots: rgba(11, 13, 17, .42), rgba(61, 99, 141, .7), rgba(86, 98, 115, .28);
  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11;
    --surface: #12161c;
    --text: #f3f5f8;
    --muted: #95a1b1;
    --line: #222933;
    --accent: #8aabd1;
    --accent-soft: #16202c;
    --disc: #56799f;
    --dots: rgba(243, 245, 248, .5), rgba(138, 171, 209, .75), rgba(149, 161, 177, .3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.mono { font-family: var(--mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.kicker { color: var(--accent); }

/* ── Top bar ── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; text-decoration: none; letter-spacing: -.01em; }
.brand i { width: 1.1rem; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--bg) 0 28%, var(--disc) 30%); }
.brand b { color: var(--accent); font-weight: 600; }
.top nav { display: flex; gap: 1.75rem; }
.top nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.top nav a:hover { color: var(--text); }

/* ── Hero (home) ── */
.hero { position: relative; overflow: hidden; padding: 0; border-bottom: 1px solid var(--line); }
.field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .wrap {
  position: relative; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  gap: 3rem; min-height: min(86vh, 780px); padding-block: 4rem;
}
.eyebrow { color: var(--accent); margin: 0 0 1.25rem; }
h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 4.3rem); line-height: 1.03; letter-spacing: -.035em; font-weight: 600; }
.lede { max-width: 34rem; margin: 1.5rem 0 1.75rem; color: var(--muted); font-size: 1.12rem; }
.tagline { max-width: 34rem; margin: -.75rem 0 2rem; color: var(--muted); font: .8rem/1.6 var(--mono); letter-spacing: .02em; }
.legend { display: grid; gap: .45rem; max-width: 34rem; margin: 0 0 2rem; padding: 0; list-style: none; font-size: .95rem; color: var(--muted); }
.legend li { display: grid; grid-template-columns: 7.5rem 1fr; align-items: baseline; gap: .75rem; }
.legend b { color: var(--text); font-weight: 500; }
.legend .badge { justify-self: start; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.3rem; border-radius: 999px;
  border: 1px solid var(--text); background: var(--text); color: var(--bg);
  font-weight: 500; text-decoration: none; transition: transform .2s;
}
.btn:hover { transform: translateY(-2px); }

/* Portrait: cut-out photo breaking out of a gray-blue disc */
.portrait { position: relative; margin: 0; aspect-ratio: 1; width: min(100%, 540px); justify-self: end; }
.portrait .disc { position: absolute; inset: 17% 11% 5%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--disc) 80%, white), var(--disc) 70%); }
.portrait .ring { position: absolute; inset: 7% 1% -5%; width: 98%; overflow: visible; animation: spin 70s linear infinite; }
.ring text { font: 500 7.2px var(--mono); letter-spacing: .3em; fill: var(--muted); }
.portrait .cut {
  position: absolute; inset: 0;
  mask-image: radial-gradient(circle at 50% 57%, #000 38.9%, transparent 39.1%), linear-gradient(#000 48%, transparent 58%), linear-gradient(120deg, transparent 4%, #000 20%);
  mask-composite: add, intersect;
}
.portrait img { position: relative; width: 100%; height: 100%; object-fit: contain; filter: contrast(1.04); }
.portrait .halftone {
  position: absolute; inset: 0; translate: -4% 3%;
  background: radial-gradient(circle, var(--accent) 1.1px, transparent 1.5px) 0 0 / 6px 6px;
  mask: url(portrait.webp) center / contain no-repeat;
  opacity: .55;
}
@keyframes spin { to { rotate: 360deg; } }

/* ── Sections ── */
section { padding-block: 5.5rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-head h2 { margin: .5rem 0 0; font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; }
.section-head p { max-width: 28rem; margin: 0; color: var(--muted); }

/* ── Status badge ── */
.badge {
  display: inline-block; padding: .3rem .6rem; border-radius: 999px; border: 1px solid currentColor;
  font: 500 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap;
}
.badge.usable { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.prototype { color: var(--text); }
.badge.experiment { color: var(--muted); border-style: dashed; }
.badge.version { color: var(--muted); letter-spacing: .04em; text-transform: none; }

/* ── Project groups and cards ── */
.group + .group { margin-top: 3.5rem; }
.group-title {
  display: flex; justify-content: space-between; margin: 0 0 1.25rem; padding-bottom: .9rem; border-bottom: 1px solid var(--text);
  font: 500 .75rem var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.group-title span { color: var(--muted); }
.notice {
  max-width: 46rem; margin: 0 0 2.75rem; padding: 1rem 1.25rem; border-left: 3px solid var(--disc);
  border-radius: 0 12px 12px 0; background: var(--accent-soft); color: var(--text); font-size: 1.02rem;
}
.notice strong { font-weight: 600; }
.group-note { margin: -.4rem 0 1.25rem; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: border-color .25s;
}
.card:is(:hover, :focus-within) { border-color: var(--accent); }
.shot { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0b0d11; }
.shot img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.08); transition: filter .5s, scale .6s; }
.shot video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  filter: grayscale(1) contrast(1.08); transition: opacity .6s, filter .5s, scale .6s;
}
.shot video.playing { opacity: 1; }
.shot::after { content: ""; position: absolute; inset: 0; background: var(--disc); mix-blend-mode: color; transition: opacity .5s; }
.card:is(:hover, :focus-within) .shot :is(img, video) { filter: none; scale: 1.02; }
.card:is(:hover, :focus-within) .shot::after { opacity: 0; }
.card-body { display: flex; flex-direction: column; gap: .9rem; flex: 1; padding: 1.25rem 1.4rem 1.2rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.card-title { margin: 0; font-size: 1.3rem; letter-spacing: -.02em; font-weight: 600; }
.card-title a { text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }  /* whole card is the link target */
.summary { margin: 0; }
.made { margin: -.5rem 0 0; color: var(--muted); font: .72rem/1.4 var(--mono); letter-spacing: .04em; }
.card-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: auto; padding-top: .9rem;
  border-top: 1px solid var(--line); color: var(--muted); font: .72rem/1.4 var(--mono); letter-spacing: .03em;
}
.card-foot .go { color: var(--accent); white-space: nowrap; }
@media (min-width: 901px) { .card-foot > :first-child { min-height: 2lh; } }  /* side-by-side cards: foot rules line up when a tech line wraps */
.note { margin: 0; color: var(--muted); font-size: .92rem; }

/* Alex's own aside: a speech bubble from a tiny avatar on the hero's disc */
.say { display: flex; align-items: flex-start; gap: .7rem; pointer-events: none; }  /* clicks fall through to the card link */
.say-face {  /* disc top meets bubble top; hair pops over it */
  position: relative; flex: none; width: 2.25rem; margin-top: -.27rem;
  transform-origin: 50% calc(100% - 1.125rem); transition: rotate .35s;
}
.say-face::before {
  content: ""; position: absolute; inset: auto 0 0; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--disc) 80%, white), var(--disc) 70%);
}
.say-face img { position: relative; width: 100%; filter: drop-shadow(0 0 .5px var(--muted)) drop-shadow(0 0 .5px var(--muted)); }  /* rim keeps the hair visible on dark cards */
.say-text {  /* the .notice's tint on purpose: both are Alex talking to the visitor */
  position: relative; min-width: 0; margin: 0; padding: .5rem .85rem .55rem; border-radius: 14px;
  background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--text));  /* gray-blue ink */
  font-size: .92rem; line-height: 1.5; overflow-wrap: anywhere;
}
.say-text::before {  /* curved tail, pointing back at the avatar's mouth */
  content: ""; position: absolute; top: .6em; right: calc(100% - 1px); width: .75em; height: .95em; background: inherit;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14' preserveAspectRatio='none'%3E%3Cpath d='M11 0Q7 8 0 12Q6 12.4 11 14Z'/%3E%3C/svg%3E") 0 0 / 100% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .card:is(:hover, :focus-within) .say-face { rotate: -8deg; }  /* a small head tilt */
}
@media (max-width: 24em) {  /* narrow screen or large text: avatar above, tail pointing up */
  .say { flex-direction: column; }
  .say-face { margin: 0; }
  .say-text::before { top: 1px; right: auto; left: 1.3em; transform-origin: 100% 0; rotate: 90deg; }
}
@media (forced-colors: active) {
  .say-text { border: 1px solid CanvasText; }
  .say-text::before { forced-color-adjust: none; background: CanvasText; }
}

/* ── Detail pages ── */
.page-head { padding-block: 4rem 0; }
.back { color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
.page-head h1 { margin-top: 1.25rem; font-size: clamp(2.3rem, 4.6vw, 3.6rem); }
.page-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 1.25rem; color: var(--muted); }
.page-head .lede { max-width: 44rem; }
.panel { padding: 1.5rem; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; border-radius: 22px; border: 1px solid var(--line); background: #0b0d11; }
.gallery figcaption { margin-top: .6rem; color: var(--muted); font-size: .9rem; }
.apps { display: grid; gap: 1.25rem; }
.app { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; }
.app img { width: 100%; border-radius: 16px; border: 1px solid var(--line); background: #000; }
.app h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.02em; }
.app .card-body { padding: 0; }

/* ── Footer ── */
footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 5.5rem; padding-block: 2rem 3rem; border-top: 1px solid var(--line); color: var(--muted); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 1rem; padding-block: 2rem 4rem; min-height: 0; }
  .portrait { order: -1; justify-self: center; width: min(78%, 420px); }
  .cards { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .section-head { flex-direction: column; align-items: start; gap: .75rem; }
}
@media (max-width: 560px) {
  .top nav { gap: 1.1rem; font-size: .95rem; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .legend li { grid-template-columns: 1fr; gap: .1rem; }
  .app { grid-template-columns: 1fr; }
  .app img { max-width: 220px; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
