/* Shared portfolio styles: tokens, base, menu, footer, case study card.
   See DESIGN-SYSTEM.md. Page-specific styles live in their own file. */

:root {
  /* Colours: Home frame */
  --surface-black: #101010;
  --black: #000000; /* hero fade end + Home body */
  --text-grey: #b7b7b7;
  --text-muted: rgba(255, 255, 255, 0.7);
  --border: rgba(255, 255, 255, 0.2);
  --text-blue: #98c1ff; /* hover / focus */

  /* Colours: full palette (Master Style Guide) */
  --surface-darkgrey: #1f1f1f;
  --surface-offwhite: #fafdff;
  --surface-lightbluegradient: linear-gradient(165.88deg, rgba(205, 233, 253, 0.5) 11.343%, rgba(255, 255, 255, 0.5) 45.853%, rgba(229, 244, 254, 0.5) 80.362%);
  --border-darkgrey: #404040;
  --border-lightgrey: #8f8f8f;
  --border-blue: #1d5bb8; /* start of border-bluegradient */
  --lego-blue: #005ad2; /* LEGO link blue: pulse highlight */
  --lego-surface: #f7f7f7; /* LEGO app: neutral layer */
  --lego-action-secondary: #e7f4fd; /* LEGO app: secondary button */
  --lego-text: #141414; /* LEGO app: default text */
  --border-paleblue: #e6f3fc; /* video frame border */
  --connector-blue: rgba(26, 103, 219, 0.8); /* #1A67DB at 80% */
  --connector-glow: rgba(255, 255, 255, 0.2);
  --connector-glow-core: rgba(255, 255, 255, 0.45);
  --border-bluegradient: linear-gradient(-43.87deg, #1d5bb8 10.091%, #d7d7d7 102.27%);
  --border-purplegradient: linear-gradient(233.55deg, #8c1db8 18.718%, #d7d7d7 124.46%);
  --text-white: #ffffff;
  --text-black: #1a1a1a;
  --text-lightgrey: rgba(26, 26, 26, 0.7);

  --font-inter: "Inter", sans-serif;
  --gutter: 180px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
/* Overscroll above the menu and below the footer matches the bars,
   even on light pages (body keeps its own background) */
html { background: var(--surface-black); }
body {
  background: var(--surface-black);
  color: #fff;
  font-family: var(--font-inter);
  -webkit-font-smoothing: antialiased;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* Menu Section / Footer Section */
.bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 var(--gutter);
  background: var(--surface-black);
}
.bar--menu { border-bottom: 1px solid var(--border); }
.bar--footer { border-top: 1px solid var(--border); }
.bar__inner {
  width: 100%;
  max-width: 1080px;
  padding: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  color: #fff;
  white-space: nowrap;
}
.menu-titles {
  display: flex;
  align-items: center;
  gap: 64px;
}
/* Menu/Footer Title */
.menu-link {
  display: block;
  width: 55px;
  height: 16px;
  font-family: var(--font-inter);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 1.28px;
  color: var(--text-grey);
  white-space: nowrap;
  transition: color 0.2s ease;
}
.menu-link:hover, .menu-link:focus-visible { color: var(--text-blue); }

.footer-message {
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: -0.36px;
  color: var(--text-grey);
  white-space: nowrap;
}
.footer-menu {
  flex: 1 0 0;
  min-width: 1px;
  display: flex;
  justify-content: flex-end;
  opacity: 0.7;
}
.footer-menu .menu-link { width: 86px; }
.menu-link[aria-current="page"] { color: var(--text-white); }

/* Case Study card */
.case {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.case__media {
  position: relative;
  width: 100%;
  height: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
}
.case__media img,
.case__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.case:hover .case__media img,
.case:hover .case__media video,
.case:focus-visible .case__media img,
.case:focus-visible .case__media video { transform: scale(1.02); }
.case__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.case:hover .case__meta,
.case:focus-visible .case__meta { color: var(--text-white); }
/* Case study title (18px, set on Home) */
.case__title { font-size: 18px; letter-spacing: 0.36px; }
/* Project Tags */
.case__tags {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  letter-spacing: 0.32px;
}

/* Smaller screens */
@media (max-width: 1440px) {
  :root { --gutter: clamp(16px, 12.5vw, 180px); }
}
@media (max-width: 900px) {
  .menu-titles { gap: 32px; }
  .menu-link { width: auto; }
  .case__media { height: auto; aspect-ratio: 3 / 2; }
}
@media (max-width: 600px) {
  .bar__inner { padding: 24px 0; }
  .logo { font-size: 20px; }
  .menu-titles { gap: 16px; }
  .menu-link { font-size: 14px; letter-spacing: 1.12px; height: auto; }
  .case__meta { flex-direction: column; align-items: flex-start; gap: 4px; white-space: normal; }
  .case__title { font-size: 18px; }
  .case__tags { font-size: 14px; }
  .footer-message { font-size: 14px; white-space: normal; }
  .footer-menu .menu-link { width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .case__media img, .case__media video, .case__meta, .menu-link { transition: none; }
}

/* Page entry: background (and menu) first, then the content fades and slides up.
   Opt in with class="cs-enter" on <body>; each page's stylesheet chooses which blocks animate. Tune the feel with these settings. */
.cs-enter {
  --enter-duration: 1100ms;
  --enter-distance: 24px;
  --enter-delay: 200ms;   /* pause on the empty background */
  --enter-stagger: 140ms; /* gap between blocks */
  --enter-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cs-enter {
  from { opacity: 0; translate: 0 var(--enter-distance); }
  to { opacity: 1; translate: 0 0; }
}
@keyframes cs-enter-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
