/* Unibyte Labs home page. The lab's colours are the logo's: its blue gradient and the pink
   from the old placeholder's glow. Earshot's card borrows Earshot's own night colours and
   wordmark (from /earshot/), so players who came for the game recognise it. */

@font-face { font-family: "Radio Canada"; src: url("/assets/fonts/RadioCanada-Variable.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/Figtree-Variable.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("/earshot/assets/fonts/PermanentMarker-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light dark;

  /* The brand */
  --blue: #256eff;        /* the logo's light end */
  --blue-deep: #1143a6;   /* its dark end */
  --pink: #e958d3;        /* the glow's accent; decoration only, never text */

  /* Light */
  --paper: #fbfcff;
  --wash: #f0f4ff;
  --ink: #101b3b;
  --ink-muted: #4c5878;
  --line: #d9e1f2;
  --line-strong: #a9b6d3;
  --link: #1755d6;
  --button: #1755d6;
  --button-hover: #1143a6;
  --on-button: #ffffff;
  --mark-a: #256eff;
  --mark-b: #1143a6;
  --glow-strength: 0.55;

  /* Earshot's night, from its design system */
  --night: #111415;
  --night-ink: #edeff0;
  --night-muted: #a1aaaf;
  --night-gold: #f7c948;
  --night-green: #56d39a;

  --font-display: "Radio Canada", "Helvetica Neue", Arial, sans-serif; /* the name and headings */
  --font-sans: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --section: clamp(72px, 10vw, 120px);
  --radius: 14px;
  --radius-lg: 24px;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1129;
    --wash: #0f1834;
    --ink: #e9eeff;
    --ink-muted: #a3aed0;
    --line: #1f2b50;
    --line-strong: #3a4a7a;
    --link: #8db2ff;
    --button: #6b9bff;
    --button-hover: #8db2ff;
    --on-button: #0a1129;
    --mark-a: #4a88ff;
    --mark-b: #1f5ad0;
    --glow-strength: 0.7;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px;
}
.skip:focus { top: 12px; }

/* The mark's gradient follows the theme. */
.mark-stop-a { stop-color: var(--mark-a); }
.mark-stop-b { stop-color: var(--mark-b); }
.mark-horn { fill: var(--mark-a); }

/* ───────── Header ───────── */
.top { position: relative; z-index: 2; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 26px; height: 36px; }
.brand-name { font: 600 1.2rem/1 var(--font-display); letter-spacing: -0.01em; }
.top-links { display: flex; gap: clamp(16px, 3vw, 32px); margin: 0; padding: 0; list-style: none; }
.top-links a { color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.top-links a:hover { color: var(--ink); }
@media (max-width: 479px) { .brand { visibility: hidden; } } /* the hero's mark is just below */

/* ───────── Hero ───────── */
.hero {
  position: relative;
  min-height: min(80vh, 760px);
  display: flex; align-items: center;
  padding: 48px 0 var(--section);
  isolation: isolate;
}
/* Runs on under the next section and fades out, so the glow never ends in an edge. */
.hero-glow {
  position: absolute; inset: -120px 0 -240px 0; z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
}
.glow { position: absolute; display: block; filter: blur(90px); opacity: var(--glow-strength); }
/* The placeholder's three shapes: a blue cloud, a pink moon and a long blue shore. */
.glow-a { left: 54%; top: 12%; width: 520px; height: 380px; background: #1f67f7; border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%; }
.glow-b { left: 78%; top: 44%; width: 220px; height: 220px; background: var(--pink); border-radius: 50%; }
.glow-c { left: 44%; top: 66%; width: 760px; height: 130px; background: #1f67f7; border-radius: 50%; opacity: calc(var(--glow-strength) * 0.6); }

.hero-mark {
  position: absolute; z-index: -1;
  right: max(var(--gutter), calc((100vw - 1160px) / 2 + 40px));
  top: 50%; transform: translateY(-54%);
  height: min(70vh, 600px); width: auto; aspect-ratio: 184 / 260;
}
.hero-copy { max-width: 1160px; }
.hero-title {
  margin: 0 0 20px;
  font: 600 clamp(3.4rem, 9vw, 7rem)/0.95 var(--font-display);
  letter-spacing: -0.03em;
  max-width: 7ch;
}
.hero-line { font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.45; color: var(--ink-muted); max-width: 24em; margin-bottom: 0; text-wrap: balance; }

/* One moment on load: the glow comes up and the mark rises into it. */
@media (prefers-reduced-motion: no-preference) {
  .glow { animation: glow-in 1.6s cubic-bezier(.2, .7, .2, 1) both; }
  .glow-b { animation-delay: .25s; }
  .glow-c { animation-delay: .1s; }
  .hero-mark { animation: mark-in 1.1s cubic-bezier(.2, .7, .2, 1) .15s both; }
  @keyframes glow-in { from { opacity: 0; transform: scale(.7); } }
  @keyframes mark-in { from { opacity: 0; transform: translateY(-48%); } }
}

@media (max-width: 859px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 16px; }
  .hero-mark { position: relative; right: auto; top: auto; transform: none; height: clamp(250px, 70vw, 300px); margin: 0 0 28px var(--gutter); align-self: flex-start; }
  .hero-title { max-width: none; } /* the wide layout's 7ch would squeeze it into the left half */
  .glow-a { left: -10%; top: 0; width: 360px; height: 280px; }
  .glow-b { left: 40%; top: 18%; width: 160px; height: 160px; }
  .glow-c { left: -20%; top: 52%; width: 520px; height: 110px; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes mark-in { from { opacity: 0; transform: translateY(14px); } }
  }
}

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius); border: 1.5px solid transparent;
  font: 600 1rem/1 var(--font-sans); text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--button); color: var(--on-button); }
.btn-primary:hover { background: var(--button-hover); }

/* ───────── Sections ───────── */
.section { position: relative; padding: var(--section) 0; } /* positioned, so it paints over the hero's glow */
.section-title { margin: 0 0 32px; font: 600 clamp(2rem, 4vw, 2.75rem)/1.1 var(--font-display); letter-spacing: -0.02em; }

/* ───────── Projects ───────── */
.project-earshot {
  display: grid; grid-template-columns: 1fr;
  background: var(--night); color: var(--night-ink);
  border-radius: var(--radius-lg); overflow: hidden;
}
.project-art { display: block; position: relative; }
.project-art img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.project-art::after {
  /* Fades the art into the night below (stacked) or to its right (side by side). */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--night));
}
.project-body { padding: 8px 28px 32px; max-width: 34em; }
.earshot-wordmark { margin: 0 0 8px; font: 400 clamp(2.6rem, 5vw, 3.6rem)/1 "Permanent Marker", "Marker Felt", cursive; text-transform: uppercase; letter-spacing: 0.01em; }
.project-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.95rem; color: var(--night-ink); margin-bottom: 18px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--night-green); box-shadow: 0 0 0 4px #56d39a2e; }
.project-body p { color: var(--night-muted); }
.project-body p.project-status { color: var(--night-ink); }
.project-meta { font-size: 0.95rem; margin-bottom: 28px !important; }
.btn-night { background: var(--night-gold); color: #0b0f12; box-shadow: inset 0 -3px 0 #00000038, 0 3px 0 #050607; }
.btn-night:hover { background: #ffd866; }
.btn-night:focus-visible { outline-color: var(--night-gold); }

@media (min-width: 860px) {
  .project-earshot { grid-template-columns: 7fr 5fr; align-items: center; }
  .project-art { height: 100%; }
  .project-art img { aspect-ratio: auto; min-height: 420px; }
  .project-art::after { background: linear-gradient(to right, transparent 60%, var(--night)); }
  .project-body { padding: 40px 44px 40px 8px; }
}

.more { margin-top: 28px; color: var(--ink-muted); }

/* ───────── About ───────── */
.section-about { background: var(--wash); }
.about { display: grid; gap: 0 40px; align-items: center; }
.about .portrait { margin-bottom: 36px; }
.portrait {
  width: 100%; max-width: min(360px, 70vw); aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: -14px 18px 50px -18px color-mix(in srgb, var(--blue) 55%, transparent), 16px -10px 50px -20px color-mix(in srgb, var(--pink) 45%, transparent);
}
.about-copy { max-width: 36em; }
.about-lede { font: 500 clamp(1.5rem, 2.6vw, 1.9rem)/1.3 var(--font-display); letter-spacing: -0.01em; color: var(--ink); margin-bottom: 20px; }
@media (min-width: 860px) {
  .about { grid-template-columns: 360px 1fr; grid-template-areas: "photo title" "photo copy"; gap: 0 72px; align-content: center; }
  .about-title { grid-area: title; align-self: end; }
  .about .portrait { grid-area: photo; margin-bottom: 0; }
  .about-copy { grid-area: copy; align-self: start; }
}

/* ───────── Consulting ───────── */
.consult {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 8px 64px;
  padding: clamp(32px, 6vw, 64px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #12275f, var(--blue-deep) 70%, #1a56cc);
  color: #f3f6ff;
}
.consult::before {
  /* A little of the hero's pink glow, in the corner. */
  content: ""; position: absolute; z-index: -1; right: -60px; top: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: var(--pink); filter: blur(80px); opacity: 0.45;
}
.consult .section-title { margin-bottom: 16px; }
.consult-copy { max-width: 34em; color: #d4ddf7; margin-bottom: 28px; }
.consult .btn-primary { background: #ffffff; color: var(--blue-deep); justify-self: start; }
.consult .btn-primary:hover { background: #e3ebff; }
/* A plain link rather than a button, so it's there for anyone looking without inviting enquiries. */
.consult-link { justify-self: start; color: #ffffff; font-weight: 600; text-decoration-color: #ffffff80; text-decoration-thickness: 1.5px; }
.consult-link:hover { text-decoration-color: #ffffff; }
.consult :focus-visible { outline-color: #ffffff; }
@media (min-width: 860px) {
  .consult { grid-template-columns: 5fr 7fr; align-items: start; }
  .consult .section-title { grid-row: span 2; }
  .consult .btn-primary, .consult-link { grid-column: 2; }
}
@media (prefers-color-scheme: dark) {
  .consult { background: linear-gradient(135deg, #0f1f4d, #133a8f 75%, #1a4fb8); box-shadow: inset 0 0 0 1px #ffffff14; }
}

/* ───────── Footer ───────── */
.footer { border-top: 1px solid var(--line); padding: 36px 0 44px; font-size: 0.95rem; color: var(--ink-muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.footer-lab { display: flex; align-items: center; gap: 14px; }
.footer-lab p { color: var(--ink); font: 600 1rem/1.4 var(--font-display); }
.footer-lab span { color: var(--ink-muted); font-weight: 400; }
.footer-mark { width: 28px; height: 40px; flex: none; }
.footer-links { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--ink-muted); }
.footer-links a:hover { color: var(--ink); }
.footer-copy { margin: 0; }
