/* ===== M3 Design Tokens — TheWeldin (mirrors mobile/lib/core/theme) ===== */
:root {
  /* Follows the system; <meta name="color-scheme"> (set by the toggle in main.js) overrides it */
  color-scheme: light dark;

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
  }

  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
  }

  --primary: light-dark(#f39322, #e8b584);
  --on-primary: light-dark(#ffffff, #3a1f02);
  --primary-container: light-dark(#ffe9d0, #5c3818);
  --on-primary-container: light-dark(#3a1f02, #ffe9d0);
  --secondary: light-dark(#1f3340, #a8bcc9);
  --on-secondary: light-dark(#ffffff, #1f3340);
  --secondary-container: light-dark(#d9e4ec, #2d4654);
  --on-secondary-container: light-dark(#152330, #d4e4f0);
  --surface: light-dark(#fbf7f2, #1f3340);
  --on-surface: light-dark(#26221c, #e2ded7);
  --on-surface-variant: light-dark(#595141, #c2bba9);
  --surface-container-low: light-dark(#f6f1ea, #223846);
  --surface-container: light-dark(#f1ece3, #273e4c);
  --surface-container-high: light-dark(#ebe5da, #304857);
  --surface-container-highest: light-dark(#e5ded1, #395364);
  --outline: light-dark(#8a8170, #8c8474);
  --outline-variant: light-dark(#d8d0be, #504a3d);

  --font: "Inter", system-ui, -apple-system, sans-serif;
  /* Landing-only display face for titles, closest free match to the logo's Syke ExtraBold Italic */
  --font-display: "Barlow Semi Condensed", var(--font);
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 20px;
  --sp-xxl: 24px;
  --sp-xxxl: 32px;
  --sp-hero: 40px;
  --sp-maximum: 48px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --radius-extra-large: 28px;
  --radius-full: 999px;
  --ease-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-short: 200ms;
  --dur-medium: 300ms;
  --dur-long: 400ms;
  --dur-extra-long: 600ms;
  --dur-ambient: 2400ms;
  --section-gap: 96px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  font-family: var(--font);
  font-weight: 400;
  background-color: var(--surface);
  color: var(--on-surface);
  line-height: 1.5;
}

ul {
  list-style: none;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  user-select: none;
}

/* ===== Layout ===== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

/* ===== Header: floating pill (app phone nav bar) ===== */
.site-header {
  position: fixed;
  top: var(--sp-md);
  left: var(--sp-md);
  right: var(--sp-md);
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: var(--sp-md);
  pointer-events: none;
}

.nav-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  width: 100%;
  /* pill + gap + round button = 1088px, the content column */
  max-width: calc(1088px - 64px - var(--sp-md));
  height: 64px;
  /* Right inset = vertical inset around the 40px .btn-sm (64 - 2px border - 40) / 2,
     so the button's arc is concentric with the pill's */
  padding: 0 11px 0 var(--sp-xxl);
  background-color: var(--surface-container);
  border: 1px solid var(--outline);
  border-radius: var(--radius-full);
  /* M3 elevation level 3 */
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.3),
    0 4px 8px 3px rgb(0 0 0 / 0.15);
}

/* Optical centering: the spark weighs the top, so the wordmark sits low */
.nav-logo {
  height: 32px;
  width: auto;
  transform: translateY(-3px);
}

.nav-links {
  display: none;
  gap: var(--sp-xs);
  margin-left: auto;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--sp-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
  border-radius: var(--radius-full);
  transition:
    background-color var(--dur-short) var(--ease-standard),
    color var(--dur-short) var(--ease-standard);
}

.nav-links a:hover {
  color: var(--on-surface);
  background-color: var(--surface-container-high);
}

/* ===== Language button & theme-dependent images ===== */
/* Round like the app's "+", same height and surface as the pill so it reads as its sibling */
.nav-round {
  pointer-events: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  color: var(--on-surface-variant);
  background-color: var(--surface-container);
  border: 1px solid var(--outline);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.3),
    0 4px 8px 3px rgb(0 0 0 / 0.15);
  transition:
    background-color var(--dur-short) var(--ease-standard),
    color var(--dur-short) var(--ease-standard);
}

.nav-round:hover {
  color: var(--on-surface);
  background-color: var(--surface-container-high);
}

.nav-pill > .btn {
  margin-left: auto;
}

.logo-for-dark,
.screen-for-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) :is(.logo-for-light, .screen-for-light) {
    display: none;
  }

  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) :is(.logo-for-dark, .screen-for-dark) {
    display: block;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) :is(.logo-for-light, .screen-for-light) {
  display: none;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) :is(.logo-for-dark, .screen-for-dark) {
  display: block;
}

/* Language switch: cross-document view transition. The pages share a layout, so the default
   cross-fade reads as the text swapping; the button is pinned so IT <-> EN morphs in place.
   Unsupported browsers (Firefox) just navigate. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .nav-round {
    view-transition-name: lang-button;
  }
}

/* ===== Buttons (pill family) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 var(--sp-xxl);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: opacity var(--dur-short) var(--ease-standard);
}

.btn:hover {
  opacity: 0.88;
}

.btn:active {
  opacity: 0.76;
}

.btn-sm {
  height: 40px;
  padding: 0 var(--sp-xl);
}

.btn-filled {
  color: var(--on-primary);
  background-color: var(--primary);
}

/* Same surface and outline as the top bar pill */
.btn-tonal {
  color: var(--on-surface);
  background-color: var(--surface-container);
  border: 1px solid var(--outline);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 var(--sp-hero);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  gap: var(--sp-hero);
  align-items: center;
}

.hero-copy {
  order: 2;
}

.eyebrow {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--primary);
  margin-bottom: var(--sp-lg);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 7.4vw, 88px);
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--sp-xxl);
}

.hero-subtitle {
  max-width: 520px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-xxxl);
}

/* Compact: stacked full-width buttons, same as .cta-actions */
.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.hero-visual {
  order: 1;
  position: relative;
  display: flex;
  justify-content: center;
}

/* Soft brand glow behind the icon */
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(
    closest-side,
    var(--primary-container),
    transparent
  );
  opacity: 0.8;
}

.hero-icon {
  position: relative;
  width: min(60vw, 260px);
  /* Signature soft shadow, as on the app's badge card; follows the icon's alpha */
  filter: drop-shadow(0 24px 48px rgb(0 0 0 / 0.22));
  animation: float calc(var(--dur-ambient) * 2) ease-in-out infinite alternate;
}

@keyframes float {
  from {
    transform: translateY(-8px) rotate(-2deg);
  }
  to {
    transform: translateY(8px) rotate(2deg);
  }
}

/* ===== Sections ===== */
.section {
  padding: var(--section-gap) 0;
  /* the watermark letter bleeds left of the column */
  overflow-x: clip;
}

.section-alt {
  background-color: var(--surface-container-low);
}

/* Section marker: giant tonal initial as a watermark under the section title */
/* Stacking context on the column, so the letter sits under the cards too */
.section:has(.section-letter) > .container {
  isolation: isolate;
}

.section-head {
  position: relative;
}

.section-letter {
  position: absolute;
  z-index: -1;
  /* Anchored to the title's top, not centred: a short head must not push it onto the cards */
  top: -0.28em;
  left: -0.06em;
  font-family: var(--font-display);
  font-size: clamp(300px, 40vw, 520px);
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  /* primaryContainer is much louder on navy than on cream: halve it in dark */
  color: light-dark(#ffe9d0, rgb(92 56 24 / 0.5));
  pointer-events: none;
  user-select: none;
}

.accent {
  color: var(--primary);
  white-space: nowrap;
}

.section-title {
  max-width: 840px;
  font-family: var(--font-display);
  font-size: clamp(34px, 4.8vw, 52px);
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: var(--sp-md);
}

.section-lead {
  max-width: 600px;
  font-size: 16px;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-maximum);
}

/* ===== FAQ: native <details> accordion, answers stay in the DOM for crawlers ===== */
.faq-list {
  display: grid;
  gap: var(--sp-lg);
}

/* Transparent border when closed, so opening does not shift the layout.
   Open gets the outline border, as on the live cards and the top bar */
.faq-item {
  background-color: var(--surface-container-low);
  border: 1px solid transparent;
  border-radius: var(--radius-large);
  transition:
    background-color var(--dur-short) var(--ease-standard),
    border-color var(--dur-short) var(--ease-standard);
}

.faq-item[open] {
  border-color: var(--outline);
}

@media (hover: hover) {
  .faq-item:not([open]):hover {
    background-color: var(--surface-container);
  }
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-xxl);
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-large);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

/* "add" icon in a circle; turns 45deg into an "x" and fills with primary when open */
.faq-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  font-size: 20px;
  background-color: var(--primary-container);
  color: var(--on-primary-container);
  transition:
    transform var(--dur-short) var(--ease-standard),
    background-color var(--dur-short) var(--ease-standard),
    color var(--dur-short) var(--ease-standard);
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
  background-color: var(--primary);
  color: var(--on-primary);
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.faq-item h3 {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
}

.faq-item p {
  max-width: 70ch;
  padding: 0 var(--sp-xxl) var(--sp-lg);
  color: var(--on-surface-variant);
}

.faq-item p + p {
  margin-top: calc(-1 * var(--sp-sm));
}

/* ===== Card (surface family) ===== */
.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-xxl);
  background-color: var(--surface-container-low);
  border-radius: var(--radius-large);
}

.section-alt .card {
  background-color: var(--surface);
}

/* Below 840px the cards are a swipe carousel, like the app's: equal size, the next one peeking.
   It bleeds to the screen edges (negative margin = container padding) so cards slide off-screen */
.card-grid {
  display: flex;
  gap: var(--sp-sm);
  margin-inline: calc(-1 * var(--sp-lg));
  padding-inline: var(--sp-lg);
  scroll-padding-inline: var(--sp-lg);
  /* hidden on y: the cards' fade-in slide would otherwise make the strip scroll vertically.
     The bottom padding (= the 20px slide, cancelled by the margin) keeps the sliding cards unclipped */
  overflow: auto hidden;
  padding-bottom: 20px;
  margin-bottom: -20px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.card-grid > .card {
  flex: 0 0 min(85%, 360px);
  scroll-snap-align: start;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--sp-sm);
  color: var(--on-primary-container);
  background-color: var(--primary-container);
  border-radius: var(--radius-large);
}

/* Live features get a warm outline; "coming soon" ones keep a transparent one so sizes match */
/* Icon beside the title; text and app detail below at full width, the detail
   pinned to the bottom so it lines up across a row */
.card-grid .card {
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: auto 1fr;
  /* the detail's row is implicit, so cards without one get no trailing gap */
  grid-template-rows: auto 1fr;
  gap: var(--sp-md) var(--sp-lg);
  align-items: center;
}

.card-grid .card-icon {
  margin-bottom: 0;
}

.card-grid :is(.card-text, .card-demo) {
  grid-column: 1 / -1;
}

.card-grid .card-text {
  align-self: start;
}

.card-grid .card:not(.card-soon) {
  /* outline border, as on the app's badge card (UI_GUIDELINES §9.1) */
  border-color: var(--outline);
}

.card-soon .card-icon {
  color: var(--on-surface-variant);
  background-color: var(--surface-container-highest);
}

.card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-sm);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.27;
}

.card-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-surface-variant);
}

/* ===== Card app details (hover on desktop, .revealed once in view on touch) ===== */
/* Badge card tilts toward the cursor like the app's badge under a drag:
   max 0.11rad, perspective 0.002 (500px), elasticOut spring back (badge_card_sheet.dart) */
.card-grid .card-tilt {
  transform: perspective(500px) rotateX(calc(var(--tilt-y, 0) * -0.11rad))
    rotateY(calc(var(--tilt-x, 0) * 0.11rad));
  transition:
    opacity var(--dur-long) var(--ease-decelerate),
    translate var(--dur-long) var(--ease-decelerate),
    transform 250ms
      linear(0, 0.5, 1, 1.25, 1.25, 1.125, 1, 0.938, 0.938, 0.969, 1, 1.016, 1.016, 1.008, 1, 0.996, 0.996, 0.998, 1);
}

/* While hovered, only smooth the cursor steps; the spring is for the release.
   .card-grid outranks .fade-in, which comes later and would reset the transition */
.card-grid .card-tilt:hover {
  transition:
    opacity var(--dur-long) var(--ease-decelerate),
    translate var(--dur-long) var(--ease-decelerate),
    transform 100ms linear;
}

/* Interactive cards: arrow, not the text I-beam */
.card[data-screen] {
  cursor: default;
}

.card-demo {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: var(--sp-xs);
  padding: var(--sp-xs) var(--sp-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  background-color: var(--surface-container-high);
  border-radius: var(--radius-full);
  transition:
    color var(--dur-medium) var(--ease-standard),
    background-color var(--dur-medium) var(--ease-standard);
}

.card-demo .material-symbols-outlined {
  font-size: 18px;
}

.card-demo .demo-on,
.card:is(:hover, .revealed) .demo-off {
  display: none;
}

.card:is(:hover, .revealed) .demo-on {
  display: inline;
}

/* Same sigma as the app's locked surname (find_result_card.dart) */
.demo-blur {
  filter: blur(5px);
  transition: filter var(--dur-medium) var(--ease-standard);
}

.card:is(:hover, .revealed) .demo-blur {
  filter: none;
}

/* Like, as the app's IconCountButton (micro_motion.dart): both states share one
   cell; each takes the curve of the way it is going, entering or leaving */
.demo-swap {
  display: inline-grid;
}

.demo-swap > * {
  grid-area: 1 / 1;
}

/* PopSwitcher: in with fade + scale 0.6→1 on easeOutBack, out on easeIn, 300ms */
.demo-pop {
  transition:
    opacity var(--dur-medium) cubic-bezier(0.175, 0.885, 0.32, 1.275),
    scale var(--dur-medium) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.demo-pop.demo-in,
.card:is(:hover, .revealed) .demo-pop.demo-out {
  opacity: 0;
  scale: 0.6;
  transition-timing-function: ease-in;
}

.card:is(:hover, .revealed) .demo-pop.demo-in {
  opacity: 1;
  scale: 1;
  transition-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.demo-filled {
  font-variation-settings: "FILL" 1;
  color: var(--primary);
}

/* AnimatedCount: rolls up when it grows, down when it shrinks; easeOutCubic in,
   easeInCubic out, 250ms, clipped */
.demo-count {
  overflow: hidden;
}

.demo-count > * {
  transition:
    opacity 250ms cubic-bezier(0.215, 0.61, 0.355, 1),
    translate 250ms cubic-bezier(0.215, 0.61, 0.355, 1);
}

.demo-count .demo-in {
  opacity: 0;
  translate: 0 60%;
  transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.card:is(:hover, .revealed) .demo-count .demo-out {
  opacity: 0;
  translate: 0 -60%;
  transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
}

.card:is(:hover, .revealed) .demo-count .demo-in {
  opacity: 1;
  translate: none;
  transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
}

.card:is(:hover, .revealed) .demo-apply {
  color: var(--on-primary-container);
  background-color: var(--primary-container);
}

/* Marketplace search: the placeholder gives way to a query typed one letter at a time
   behind a blinking caret; leaving deletes it the same way */
.demo-search {
  color: var(--on-surface-variant);
}

/* Placeholder and query share one cell, as in a real text field */
.demo-field {
  display: inline-grid;
}

.demo-field > * {
  grid-area: 1 / 1;
}

/* Comes back only once the query is fully deleted (the typing duration) */
.demo-hint {
  transition: opacity 0s 700ms;
}

.demo-type {
  display: inline-block;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--on-surface);
  border-right: 2px solid transparent;
  transition: max-width 700ms steps(14);
}

.card:is(:hover, .revealed) .demo-hint {
  opacity: 0;
  transition-delay: 0s;
}

/* ponytail: 8em fits "Overhead crane"; widen it if the query changes */
.card:is(:hover, .revealed) .demo-type {
  max-width: 8em;
  animation: demo-caret 1s step-end infinite;
}

@keyframes demo-caret {
  50% {
    border-right-color: var(--primary);
  }
}

/* On touch the details flip once the card has faded in */
.card.revealed :is(.card-demo, .demo-blur, .demo-pop, .demo-count > *, .demo-hint, .demo-type) {
  transition-delay: var(--dur-long);
}

/* ===== Platform preview (phone frame, swapped by hovering a card) ===== */
.platform-preview {
  position: relative;
  width: 220px;
  margin: var(--sp-xxl) auto 0;
  background-color: var(--surface-container);
  border: 1px solid var(--outline);
  border-radius: var(--radius-extra-large);
  /* M3 elevation level 3 */
  box-shadow:
    0 1px 3px rgb(0 0 0 / 0.3),
    0 4px 8px 3px rgb(0 0 0 / 0.15);
  padding: var(--sp-xs);
  user-select: none;
}

/* Clips the sliding screens, so they enter from the screen's edge.
   The ratio sits here, not on the frame, so the screenshots fit whole, uncropped */
.platform-screens {
  position: relative;
  aspect-ratio: 1080 / 2300;
  overflow: hidden;
  /* Concentric with the frame: its radius minus the 1px border and the padding */
  border-radius: calc(var(--radius-extra-large) - 1px - var(--sp-xs));
  /* iOS Safari ignores the rounded overflow clip on the transformed screens; clip-path it is */
  clip-path: inset(0 round calc(var(--radius-extra-large) - 1px - var(--sp-xs)));
}

.platform-screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Rounded on their own too: iOS Safari doesn't clip these transformed layers to the parent */
  border-radius: inherit;
  opacity: 0;
  transform: translateX(var(--sp-xxl));
  pointer-events: none;
  transition:
    opacity var(--dur-extra-long) var(--ease-standard),
    transform var(--dur-extra-long) var(--ease-standard);
}

/* Login by default; a hovered card swaps in its screen. Learn has none, so login stays */
.platform-screen[data-screen="login"] {
  opacity: 1;
  transform: none;
}

/* Real hover, grid layout only: a tap on touch leaves a sticky :hover that would swap the screen,
   and in the carousel only scrolling picks it */
@media (hover: hover) and (min-width: 840px) {
  .platform-layout:has([data-screen="badge"]:hover) .platform-screen[data-screen="badge"],
  .platform-layout:has([data-screen="find_recruit"]:hover) .platform-screen[data-screen="find_recruit"],
  .platform-layout:has([data-screen="feed"]:hover) .platform-screen[data-screen="feed"],
  .platform-layout:has([data-screen="opportunities"]:hover) .platform-screen[data-screen="opportunities"],
  .platform-layout:has([data-screen="marketplace"]:hover) .platform-screen[data-screen="marketplace"] {
    opacity: 1;
    transform: none;
  }

  .platform-layout:has(.card[data-screen]:hover) .platform-screen[data-screen="login"] {
    opacity: 0;
  }
}

/* Carousel: the card snapped in view (.active, set in main.js) swaps the screen, as hover does */
@media (max-width: 839px) {
  /* Carousel under the phone, so the swiped card and its screen stay in view together */
  .platform-layout {
    display: flex;
    flex-direction: column;
  }

  .platform-preview {
    order: -1;
    margin: 0 auto var(--sp-xxl);
  }

  .platform-layout:has([data-screen="badge"].active) .platform-screen[data-screen="badge"],
  .platform-layout:has([data-screen="find_recruit"].active) .platform-screen[data-screen="find_recruit"],
  .platform-layout:has([data-screen="feed"].active) .platform-screen[data-screen="feed"],
  .platform-layout:has([data-screen="opportunities"].active) .platform-screen[data-screen="opportunities"],
  .platform-layout:has([data-screen="marketplace"].active) .platform-screen[data-screen="marketplace"] {
    opacity: 1;
    transform: none;
  }

  .platform-layout:has(.card[data-screen].active) .platform-screen[data-screen="login"] {
    opacity: 0;
  }
}

/* App superellipse (continuous corner) where the browser supports it */
@supports (corner-shape: squircle) {
  .card,
  .card-icon,
  .platform-preview,
  .platform-screens,
  .platform-screen,
  .avatar-company {
    corner-shape: superellipse(1.5);
  }

  /* The circular clip-path would cut the squircle back to round; overflow clips fine here */
  .platform-screens {
    clip-path: none;
  }
}

/* ===== Tags (app TagChip: pill, no border, surfaceContainerHigh) ===== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-sm);
  margin-top: var(--sp-md);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-xs) var(--sp-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface);
  background-color: var(--surface-container-high);
  border-radius: var(--radius-full);
}

.tag-more {
  color: var(--on-surface-variant);
  background-color: transparent;
  box-shadow: inset 0 0 0 1px var(--outline-variant);
}

.tag-soon {
  padding: 2px var(--sp-sm);
  font-size: 11px;
  color: var(--on-primary-container);
  background-color: var(--primary-container);
}

/* ===== Audience ===== */
.audience-grid {
  display: grid;
  gap: var(--sp-sm);
}

/* isolate: the cover band (z-index -1) paints over the card background, under the content */
.audience-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: var(--sp-xxxl);
}

/* Cover band as in the profile hero (SeededPattern): edge to edge, as tall as the
   padding plus the avatar ring, fading out downwards, onX colour at 12% */
.audience-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: calc(var(--sp-xxxl) + 64px + var(--sp-xs));
  background-color: var(--on-surface);
  opacity: 0.12;
  mask-image: var(--pattern), linear-gradient(#000, transparent);
  mask-composite: intersect;
}

/* No-JS fallback: main.js replaces --pattern with a random motif on load.
   Weld bead motif: overlapping crescents, radius = spacing 12, step 0.7x, rows 3x */
.audience-person {
  --pattern: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><pattern id='p' width='8.4' height='36' patternUnits='userSpaceOnUse' patternTransform='rotate(-20)'><path d='M4.11 6.73A12 12 0 0 1 4.11 29.27M-4.29 6.73A12 12 0 0 1-4.29 29.27' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'/></pattern><rect width='100%' height='100%' fill='url(%23p)'/></svg>");
}

/* Stripes motif, spacing 16 */
.audience-company {
  --pattern: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><pattern id='p' width='16' height='16' patternUnits='userSpaceOnUse' patternTransform='rotate(20)'><path d='M8 0V16' stroke='black' stroke-width='1.5'/></pattern><rect width='100%' height='100%' fill='url(%23p)'/></svg>");
}

.audience-head {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-bottom: var(--sp-md);
}

/* Persons are circles, companies are superellipse squares, as in UserAvatar.
   The ring in the card colour keeps the cover pattern off the avatar's edge */
.audience-avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  font-size: 32px;
  color: var(--on-secondary-container);
  background-color: var(--secondary-container);
  box-shadow: 0 0 0 var(--sp-xs) var(--surface);
}

/* Section divider with a centred label, as "Profile highlights" in the badge */
.label-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  margin-top: var(--sp-lg);
  font-size: 14px;
  color: var(--on-surface-variant);
}

.label-divider::before,
.label-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--outline-variant);
}

.avatar-person {
  border-radius: 50%;
}

.avatar-company {
  border-radius: var(--radius-large);
}

/* Company accent bar: 2px primary stripe, full height, clipped by the card's
   corners like PostCard (Stack + Positioned under Clip.antiAlias) */
.audience-company::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background-color: var(--primary);
}

/* ===== Closing CTA ===== */
.cta-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cta-panel .section-lead {
  color: inherit;
  opacity: 0.8;
  margin-bottom: var(--sp-xxxl);
}

/* Compact: stacked full-width buttons, horizontal divider */
.cta-actions {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: var(--sp-md);
}

.cta-divider {
  height: 1px;
  background-color: currentColor;
  opacity: 0.3;
}

/* Store badges stay black in both themes, per Apple/Google guidelines */
.store-btn {
  gap: var(--sp-sm);
  padding: 0 var(--sp-xl);
  color: #fff;
  background-color: #000;
  border: 1px solid #a6a6a6;
}

.store-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.store-btn span {
  display: flex;
  flex-direction: column;
  font-size: 16px;
  line-height: 1.1;
  text-align: left;
}

.store-btn small {
  font-size: 10px;
  font-weight: 400;
}

/* ===== Footer ===== */
.site-footer {
  padding: var(--sp-hero) 0;
  border-top: 1px solid var(--outline-variant);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-xxxl);
}

.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-sm);
  font-style: normal;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  color: var(--on-surface);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-sm) var(--sp-xxl);
  margin-top: var(--sp-hero);
  border-top: 1px solid var(--outline-variant);
}

/* Higher specificity than the ≥600px .container padding shorthand, which would reset it */
.site-footer .footer-bottom {
  padding-top: var(--sp-xxl);
}

.footer-logo {
  height: 64px;
  width: auto;
  margin-bottom: var(--sp-sm);
}

.footer-text {
  font-size: 12px;
  color: var(--on-surface-variant);
}

a.footer-text:hover {
  color: var(--on-surface);
}

.footer-link {
  text-decoration: underline;
}

/* Privacy + cookie links: kept together, split by a "|" */
.footer-legal {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

/* Segmented pill, the active option filled */
.segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--outline-variant);
  border-radius: 999px;
}

.segmented :is(a, button) {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
  text-decoration: none;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.segmented :is(a, button):hover {
  color: var(--on-surface);
}

.segmented [aria-pressed="true"] {
  background: var(--primary-container);
  color: var(--on-primary-container);
}

@media (max-width: 839px) {
  .footer-inner,
  .footer-bottom {
    text-align: center;
    justify-content: center;
  }

  .footer-col {
    align-items: center;
  }
}

/* ===== Cookie banner ===== */
button.footer-text {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button.footer-text:hover {
  color: var(--on-surface);
}

.cookie-banner {
  position: fixed;
  z-index: 100;
  right: var(--sp-lg);
  bottom: var(--sp-lg);
  left: var(--sp-lg);
  max-width: 440px;
  padding: var(--sp-xxl);
  color: var(--on-surface);
  background-color: var(--surface-container-high);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-extra-large);
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.18);
  animation: cookie-in var(--dur-long) var(--ease-decelerate);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  margin-bottom: var(--sp-sm);
}

.cookie-text {
  font-size: 14px;
  color: var(--on-surface-variant);
}

.cookie-text a {
  color: var(--on-surface);
  text-decoration: underline;
}

/* Reject and Accept share size and weight, as the Garante privacy guidelines require */
.cookie-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
  margin-top: var(--sp-xl);
}

.cookie-actions .btn {
  font-family: var(--font);
  cursor: pointer;
}

.cookie-actions .btn-filled {
  border: 1px solid var(--primary);
}

@keyframes cookie-in {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}

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

/* ===== Scroll reveal ===== */
/* translate, not transform, so the badge card's tilt transform stays free */
.fade-in {
  opacity: 0;
  translate: 0 20px;
  transition:
    opacity var(--dur-long) var(--ease-decelerate),
    translate var(--dur-long) var(--ease-decelerate);
}

.fade-in.visible {
  opacity: 1;
  translate: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-icon,
  .demo-type {
    animation: none;
  }

  .fade-in {
    opacity: 1;
    translate: none;
    transition: none;
  }

  .card-demo,
  .demo-blur,
  .demo-pop,
  .demo-count > *,
  .demo-hint,
  .demo-type {
    transition: none;
  }

  .platform-screen {
    transform: none;
  }
}

/* ===== Medium (≥600px) ===== */
@media (min-width: 600px) {
  .container {
    padding: 0 var(--sp-xxl);
  }

  .card-grid {
    margin-inline: calc(-1 * var(--sp-xxl));
    padding-inline: var(--sp-xxl);
    scroll-padding-inline: var(--sp-xxl);
  }

  .hero-actions {
    flex-direction: row;
  }

  /* Centred from here up; on a phone the stacked full-width buttons sit better under left-aligned text */
  .cta-panel {
    align-items: center;
    text-align: center;
  }

  .cta-actions {
    flex-direction: row;
    align-items: center;
    align-self: center;
  }

  .cta-divider {
    width: 1px;
    height: 32px;
  }
}

/* ===== Expanded (≥840px) ===== */
@media (min-width: 840px) {
  .nav-links {
    display: flex;
  }

  .nav-pill > .btn {
    margin-left: 0;
  }

  .hero-inner {
    grid-template-columns: 1.1fr 1fr;
    gap: var(--sp-maximum);
  }

  .hero-copy,
  .hero-visual {
    order: 0;
  }

  .hero-icon {
    width: min(40vw, 480px);
  }

  /* Letter steps out of the column, its bowl still under the title's start */
  .section-letter {
    left: -0.27em;
  }

  /* 2x3 cards, the phone preview in the freed column */
  .platform-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--sp-maximum);
  }

  .card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .platform-preview {
    width: 280px;
    margin: 0;
  }

  .audience-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
