/* =========================================================
   Lumogate – style.css
   Dark, modern, minimalist. Mobile-first & responsive.
   ========================================================= */

/* ---- Design tokens ---- */
:root {
  /* Colors – neutrals warmed toward the logo's plum hue (303°) */
  --color-bg: #0e0b0e;
  --color-bg-alt: #171116;
  --color-surface: #221a22;
  --color-surface-hover: #2e232d;
  --color-border: rgba(210, 172, 208, 0.1);
  --color-border-strong: rgba(210, 172, 208, 0.2);
  --color-text: #eeebee;
  --color-text-muted: #b0a0af;
  --color-text-faint: #746173;
  /* Brand: the logo's exact deep aubergine, used as a deep surface */
  --color-brand-deep: #443143;
  --color-accent: #c099bf;
  --color-accent-strong: #ab71a9;
  --color-accent-glow: rgba(171, 113, 169, 0.22);

  /* Typography */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Space Grotesk", var(--font-body);

  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3.5rem;
  --space-2xl: 6rem;

  /* Layout */
  --header-height: 7rem; /* sticky header offset for anchor scrolling */
  --container-max: 1200px;
  --radius: 14px;
  --radius-sm: 10px;

  /* Effects */
  --transition: 0.25s ease;
}

/* ---- Reset & base ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Offset anchor targets so the sticky header doesn't cover them. */
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
  /* Clip anything that sits off the right edge (e.g. the mobile nav panel
     parked off-canvas) so it never creates a horizontal scrollbar. `clip`
     (not `hidden`) avoids turning this into a scroll container, which would
     break the sticky header. */
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  /* Subtle ambient glow at the top */
  background-image: radial-gradient(
    60% 50% at 50% -10%,
    rgba(171, 113, 169, 0.08),
    transparent 70%
  );
  background-repeat: no-repeat;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

.section {
  padding-block: var(--space-2xl);
}

.section--alt {
  background-color: var(--color-bg-alt);
  border-block: 1px solid var(--color-border);
}

.section__head {
  max-width: 640px;
  margin-bottom: var(--space-xl);
}

.section__title {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  margin-bottom: var(--space-sm);
}

/* Decorative accent rule under section titles (inherits theme accent). */
.section__title::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin-top: var(--space-md);
  background-color: var(--color-accent);
  border-radius: 2px;
}

.section__intro {
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--color-border);
}

/* Glass background lives on a pseudo-element rather than the header itself, so
   the header does NOT become a containing block for position:fixed descendants
   (backdrop-filter would do that). That lets the mobile nav centre against the
   viewport instead of the short header bar. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: rgba(10, 12, 16, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Right-hand header group: section nav + the contact CTA. */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Section navigation. */
.site-nav {
  display: none;
}

.site-nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

.site-nav__link:hover {
  color: var(--color-accent);
}

/* Hamburger toggle: hidden on desktop, revealed on mobile below. */
.nav-toggle {
  display: none;
}

/* Mobile / narrow screens: the nav becomes a panel that slides in from the
   right when the hamburger is tapped; the hamburger morphs into a close (X). */
@media (max-width: 899px) {
  .nav-toggle {
    /* A flap that juts out below the header on the right (not inside the bar). */
    position: absolute;
    top: 100%;
    right: var(--space-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 2.2rem;
    padding: 0;
    cursor: pointer;
    color: var(--color-text-muted);
    /* aligned with the header's content edge */
    background-color: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.55);
    z-index: 70;
    transition: color var(--transition), border-color var(--transition),
      background-color var(--transition), transform var(--transition);
  }
  .nav-toggle:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background-color: var(--color-surface-hover);
    transform: translateY(2px);
  }
  .nav-toggle__bars,
  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background-color: currentColor;
    transition: transform var(--transition), opacity var(--transition),
      background-color var(--transition);
  }
  .nav-toggle__bars {
    position: relative;
  }
  .nav-toggle__bars::before {
    position: absolute;
    left: 0;
    top: -6px;
  }
  .nav-toggle__bars::after {
    position: absolute;
    left: 0;
    top: 6px;
  }
  /* Open state: middle bar vanishes, the other two cross into an X. */
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars {
    background-color: transparent;
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
    transform: translateY(6px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
    transform: translateY(-6px) rotate(-45deg);
  }

  .site-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: var(--space-sm);
    /* Free-floating panel, dropping below the hamburger flap (which is 2rem
       tall at top:100%) and inset from the right edge. Anchored to the sticky
       header so it follows along on scroll. */
    position: absolute;
    top: calc(100% + 2.2rem + var(--space-xs));
    right: var(--space-xs);
    z-index: 60;
    min-width: 11rem;
    padding: var(--space-md);
    /* 0.7-opacity surface so the page shows through the panel */
    background-color: color-mix(in srgb, var(--color-surface) 70%, transparent);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px -16px rgba(0, 0, 0, 0.55);
    backdrop-filter: saturate(140%) blur(8px);
    /* Hidden off-screen to the right until opened. */
    transform: translateX(110%);
    visibility: hidden;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
  }
  .site-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.3s ease, visibility 0s;
  }
  .site-nav__link {
    font-size: 0.9rem;
    text-align: right;
  }

  /* The light/dark toggle joins the rail as a normal item at the bottom,
     dropping its desktop "tab" styling. Scoped to .site-header so it overrides
     the theme defaults. */
  .site-header .mode-toggle {
    position: static;
    order: 1;
    width: auto;
    height: auto;
    padding: 0;
    margin-top: var(--space-xs);
    border: none;
    border-radius: 0;
    box-shadow: none;
    background-color: transparent;
  }
  .site-header .mode-toggle:hover {
    transform: none;
    background-color: transparent;
  }
}

/* Desktop: the nav sits inline in the header bar. */
@media (min-width: 900px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }
}

/* Source logo is dark aubergine on transparent; render white for the dark UI. */
.brand__logo {
  height: 70px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

/* ---- Light/dark mode toggle ----
   A small tab that juts out below the header bar (out of the main menu),
   anchored to the header's bottom edge on the right. */
.mode-toggle {
  position: absolute;
  top: 100%;
  right: var(--space-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 1.9rem;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  /* Round only the bottom corners so it reads as a tab hanging off the bar. */
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 4px 10px -8px rgba(0, 0, 0, 0.5);
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition), transform var(--transition);
}

.mode-toggle:hover {
  color: var(--color-accent);
  background-color: var(--color-surface-hover);
  /* nudge it a touch further out on hover */
  transform: translateY(2px);
}

.mode-toggle__icon {
  line-height: 1;
  font-size: 1.05rem;
}

/* Icon shows the mode you'll switch *to* (☾ in light, ☀ in dark). The active
   theme may swap these glyphs for icon-font equivalents. */
.mode-toggle__icon::before {
  content: "\263E";
}

html[data-mode="dark"] .mode-toggle__icon::before {
  content: "\2600";
}

.brand__tagline {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  padding-left: var(--space-sm);
  border-left: 1px solid var(--color-border-strong);
}

.nav-cta {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-xs) var(--space-xs);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  transition: color var(--transition), border-color var(--transition);
}

.nav-cta:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

/* ---- Hero ---- */
.hero {
  /* Fill the screen on mobile. dvh tracks the visible viewport as the
     browser address bar shows/hides; vh is the fallback for old engines. */
  display: flex;
  align-items: center;
  /* Subtract the sticky header so the hero fills the *remaining* screen
     rather than overflowing past the fold. */
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

.hero__inner {
  max-width: 760px;
}

.hero__title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  margin-bottom: var(--space-md);
  background: linear-gradient(180deg, #ffffff 30%, #b8c0d2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero__subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--color-text-muted);
  max-width: 620px;
  margin-bottom: var(--space-xl);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* Phones: stack the hero CTAs full-width so they're even and easy to tap. */
@media (max-width: 600px) {
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero__actions .btn {
    width: 100%;
  }
}

/* Theme-scoped decorative extras: hidden by default, revealed by the
   Blueprint theme (themes/theme-4.css), which loads after this file. */
.hero__term,
.hero__blob,
.site-ticker {
  display: none;
}

/* ---- About ---- */
.about {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

.about__body {
  max-width: 760px;
}

.about__text {
  margin-top: var(--space-md);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--color-text-muted);
}

/* Brand logo tile on the right of the About section. Self-contained image
   (white wordmark on the brand plum) — no theme invert filter. */
.about__logo {
  display: none; /* hidden on mobile; shown from 900px (see below) */
  width: 400px;
  height: auto;
  max-width: 100%;
  justify-self: start;
  /* Floating shadow beneath the wordmark. */
  filter: drop-shadow(0 119px 44px rgba(40, 28, 38, 0.3));
  /* Slow, organic drift so the logo looks like it floats. */
  animation: about-logo-float 22s ease-in-out infinite;
  will-change: transform;
}

/* Wandering, never-quite-repeating path for a gentle floating feel. */
@keyframes about-logo-float {
  0%   { transform: translate(0, 0) rotate(0deg); }
  17%  { transform: translate(9px, -7px) rotate(0.4deg); }
  33%  { transform: translate(-6px, 5px) rotate(-0.5deg); }
  50%  { transform: translate(7px, 9px) rotate(0.3deg); }
  67%  { transform: translate(-9px, -4px) rotate(-0.3deg); }
  83%  { transform: translate(4px, -8px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .about__logo { animation: none; }
}

@media (min-width: 900px) {
  .about {
    grid-template-columns: 1fr auto;
  }
  .about__logo {
    display: block;
    justify-self: end;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), background-color var(--transition),
    border-color var(--transition), box-shadow var(--transition);
}

/* The hidden attribute must win over .btn's display value. */
.btn[hidden] {
  display: none;
}

.btn--primary {
  background-color: var(--color-accent-strong);
  color: #2a1322;
  box-shadow: 0 0 0 0 var(--color-accent-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -8px var(--color-accent-glow);
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.btn--ghost:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

/* ---- Grids ---- */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid--cards {
  grid-template-columns: 1fr;
}

.grid--projects {
  grid-template-columns: 1fr;
}

/* ---- Cards (skills & profile) ---- */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  transition: border-color var(--transition), transform var(--transition),
    background-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--color-border-strong);
  background-color: var(--color-surface-hover);
  transform: translateY(-3px);
}

.card__title {
  font-size: 1.15rem;
  margin-bottom: var(--space-xs);
}

.card__text {
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

/* Services section: a soft plum-tinted band so the block reads as distinct
   from the neighbouring sections. */
#services {
  background-image: linear-gradient(
    180deg,
    color-mix(in srgb, var(--plum) 12%, var(--color-bg)) 0%,
    var(--color-bg) 55%
  );
}

/* Service cards: each carries its own accent (--accent) in a palette derived
   from the brand plum (#443143, hue 303). The accent drives the top bar, the
   faint tint, and the interactive hover glow so the card stays in the family. */
#services-list .card {
  --accent: var(--plum);
  padding: var(--space-md);
  border-top-width: 0;
  background-image:
    linear-gradient(180deg, var(--accent) 0 4px, transparent 4px),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 8%, transparent),
      transparent 55%
    );
}
#services-list .card:nth-child(1) { --accent: #443143; }
#services-list .card:nth-child(2) { --accent: #6d3a5a; }
#services-list .card:nth-child(3) { --accent: #4a3a6b; }
#services-list .card:nth-child(4) { --accent: #834b5f; }

/* Bento tile layout. Every card is a flex column so titles align and tiles
   fill their grid cell to equal heights. Grid areas are assigned here and the
   actual track layout is set per breakpoint below. */
#services-list .card {
  display: flex;
  flex-direction: column;
}

/* Featured tile: "Skräddarsydda lösningar" is the primary offering — it gets
   the largest tile, a centred layout, bolder type and a thicker accent bar. */
#services-list .card:nth-child(1) {
  justify-content: center;
  padding: var(--space-lg);
  background-image:
    linear-gradient(180deg, var(--accent) 0 6px, transparent 6px),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 12%, transparent),
      transparent 60%
    );
}
#services-list .card:nth-child(1) .card__title {
  font-size: clamp(1.4rem, 3.4vw, 2rem);
}
#services-list .card:nth-child(1) .card__text {
  font-size: 1.1rem;
  max-width: 46ch;
}
#services-list .card:nth-child(1):hover {
  background-image:
    linear-gradient(180deg, var(--accent) 0 8px, transparent 8px),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 20%, transparent),
      transparent 65%
    );
}

/* Tablet: featured spans the top row, the other three tile beneath it. The
   grid-area names are assigned here (not unconditionally) so that below 720px
   the cards simply stack in source order rather than chasing named areas that
   don't exist in the single-column layout. */
@media (min-width: 720px) {
  #services-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    grid-template-areas:
      "feature feature"
      "two     three"
      "four    four";
  }
  #services-list .card:nth-child(1) { grid-area: feature; }
  #services-list .card:nth-child(2) { grid-area: two; }
  #services-list .card:nth-child(3) { grid-area: three; }
  #services-list .card:nth-child(4) { grid-area: four; }
}

/* Desktop: a true bento — tall featured tile on the left, two stacked tiles
   top-right, one wide tile bottom-right. */
@media (min-width: 1000px) {
  #services-list {
    grid-template-columns: 1.3fr 1fr 1fr;
    grid-auto-rows: 1fr;
    grid-template-areas:
      "feature two  three"
      "feature four four";
  }
}

/* Interactive hover: lift further, thicken the top bar to 6px, glow in the
   card's own accent, and pull the border toward that accent. */
#services-list .card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent) 60%, transparent);
  background-image:
    linear-gradient(180deg, var(--accent) 0 6px, transparent 6px),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 16%, transparent),
      transparent 60%
    );
}
#services-list .card:hover .card__title {
  color: color-mix(in srgb, var(--accent) 70%, var(--color-text));
}

/* Profile icons ("Varför Lumogate?"): a coloured glyph per card, in a palette
   that harmonises with the brand plum. Higher specificity than the per-theme
   icon rules, so it recolours the glyph on any theme that shows icons. */
#profile-list .card:nth-child(1)::before { color: #9c3f6b; }
#profile-list .card:nth-child(2)::before { color: #e0d016; }
#profile-list .card:nth-child(3)::before { color: #2f8f8f; }

/* ---- Projects ---- */
.project {
  display: flex;
  gap: var(--space-md);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-lg);
  transition: border-color var(--transition), transform var(--transition);
}

.project:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

.project__index {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
  flex-shrink: 0;
  padding-top: 0.2rem;
}

.project__title {
  font-size: 1.2rem;
  margin-bottom: var(--space-xs);
}

.project__text {
  color: var(--color-text-muted);
  font-size: 0.98rem;
}

/* Projects as an editorial list (not cards). Scoped with #projects-list so it
   overrides every theme's .project box styling, while the themes keep control
   of the index/title colours and fonts. */
#projects-list {
  grid-template-columns: 1fr;
  gap: 0;
}
#projects-list .project {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: var(--space-lg);
  align-items: baseline;
  background: none;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
  padding: var(--space-lg) 0;
  transition: border-color var(--transition);
}
#projects-list .project:last-child {
  border-bottom: 1px solid var(--color-border);
}
#projects-list .project:hover {
  background: none;
  transform: none;
  box-shadow: none;
  border-top-color: var(--color-accent);
}
#projects-list .project__index {
  padding-top: 0;
}

@media (min-width: 720px) {
  #projects-list .project {
    grid-template-columns: 5rem 1fr;
    gap: var(--space-2xl);
  }
}

/* ---- Technical profile (consultant recruiters) ---- */
.tech-role {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.tech-subtitle {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

/* ---- CV password gate ---- */
.cv-gate {
  margin: var(--space-xl) auto 0;
  max-width: 420px;
}

.cv-gate__hint {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.cv-gate__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.cv-gate__input {
  flex: 1 1 200px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 0.85rem 1.4rem;
  transition: border-color var(--transition);
}

.cv-gate__input::placeholder {
  color: var(--color-text-faint);
}

.cv-gate__input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.cv-gate__row .btn {
  flex: 0 0 auto;
}

.cv-gate__error {
  margin-top: var(--space-sm);
  color: #f87171;
  font-size: 0.9rem;
}

.tech-cv {
  margin-top: var(--space-xl);
}

/* ---- Tech logos: partner-style logo wall (recolorable Simple Icons) ---- */
.tech-logos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: var(--space-xl) auto 0;
  background-color: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.tech-logos__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background-color: var(--color-bg);
  transition: background-color var(--transition);
}

.tech-logos__cell:hover {
  background-color: var(--color-surface-hover);
}

.techlogo {
  display: inline-block;
  width: 34px;
  height: 34px;
  background-color: var(--color-text-faint);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
  transition: background-color var(--transition), transform var(--transition);
}

/* Logo wall uses full-colour brand SVGs. */
.techlogo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  transition: transform var(--transition), filter var(--transition);
}

.tech-logos__cell:hover .techlogo-img {
  transform: translateY(-2px) scale(1.05);
}

@media (min-width: 560px) {
  .tech-logos { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .tech-logos {
    grid-template-columns: repeat(4, 1fr);
    max-width: 60%;
  }
}

/* ---- CTA / Contact ---- */
/* Deep brand-colored band: the logo's exact aubergine, eased into the bg. */
.section--cta {
  background-image: linear-gradient(
    180deg,
    var(--color-brand-deep) 0%,
    var(--color-bg) 100%
  );
}

.cta {
  text-align: center;
  max-width: 680px;
}

.cta__title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: var(--space-md);
}

.cta__text {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  margin-bottom: var(--space-xl);
}

.cta__channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
}

.channel {
  font-weight: 500;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  color: var(--color-text);
  transition: border-color var(--transition), color var(--transition),
    background-color var(--transition);
}

.channel:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-lg);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer .brand__logo {
  height: 48px;
  width: 48px;
  align-self: flex-start;
  border-radius: 8px;
  /* This is a finished logo tile (white wordmark on the brand plum);
     never apply the dark-theme invert filter to it. */
  filter: none;
}

.site-footer__meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.site-footer__sep {
  margin-inline: 0.4em;
  color: var(--color-text-faint);
}

.site-footer__end {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.site-footer__note {
  color: var(--color-text-faint);
  font-size: 0.9rem;
  font-style: italic;
}

.site-footer__copy {
  color: var(--color-text-faint);
  font-size: 0.85rem;
}

@media (min-width: 720px) {
  .site-footer__end {
    align-items: flex-end;
    text-align: right;
  }
}

/* ---- Design switcher ---- */
.theme-switcher {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  z-index: 100;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: var(--space-sm);
}

.theme-switcher__toggle {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  transition: border-color var(--transition), background-color var(--transition);
}

.theme-switcher__toggle:hover {
  border-color: var(--color-accent);
  background-color: var(--color-surface-hover);
}

.theme-switcher__slots {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.7);
}

.theme-slot {
  font-family: var(--font-body);
  font-size: 0.9rem;
  text-align: left;
  color: var(--color-text-muted);
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition),
    background-color var(--transition);
}

.theme-slot:hover {
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

.theme-slot.is-active {
  color: var(--color-text);
  border-color: var(--color-accent);
  background-color: var(--color-surface-hover);
}

/* ---- Scroll-reveal (added via JS) ---- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger cards/projects within their grid for a cascading reveal. */
.grid .card:nth-child(2),
.grid .project:nth-child(2) {
  transition-delay: 0.08s;
}
.grid .card:nth-child(3),
.grid .project:nth-child(3) {
  transition-delay: 0.16s;
}
.grid .card:nth-child(4) {
  transition-delay: 0.24s;
}

/* ---- Responsive (tablet & up) ---- */
@media (min-width: 720px) {
  .grid--cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 1000px) {
  .grid--cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid--projects {
    grid-template-columns: repeat(3, 1fr);
  }

  .project {
    flex-direction: column;
  }
}

/* ---- Accessibility: respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
