/*
 * WorldSkills Shanghai 2026 card layout.
 * Hex values are sampled from the reference screenshot.
 */

:root {
  /* Card fills */
  --ws-navy: #183765; /* welcome + live streaming */
  --ws-teal: #39779e; /* photos */
  --ws-purple: #450d66; /* register */
  --ws-mist: #f7f7f7; /* photo caption panel */
  --ws-white: #ffffff; /* page and gutters */

  /* Accents */
  --ws-magenta: #c3145f; /* "The stage is set" and chevron pattern */
  --ws-blue: #335c8a; /* live-streaming chart */
  --ws-mint: #9ee3d0; /* isometric cube */
  --ws-ice: #c8d3e5; /* cube wireframe on navy */

  /* Semantic roles */
  --color-bg: var(--ws-white);
  --color-surface: var(--ws-mist);
  --color-text: var(--ws-navy);
  --color-text-on-brand: var(--ws-white);
  --color-accent: var(--ws-magenta);
  --color-border: var(--ws-ice);

  --color-welcome: var(--ws-navy);
  --color-stage: var(--ws-magenta);
  --color-photos: var(--ws-teal);
  --color-live: var(--ws-navy);
  --color-register: var(--ws-purple);

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--color-accent);
  color: var(--color-text-on-brand);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mosaic {
  display: grid;
  grid-template-columns: minmax(20rem, 0.9fr) minmax(0, 1.7fr);
  gap: 14px;
  width: min(1480px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 14px;
  background: var(--color-bg);
}

.hero,
.tools {
  min-width: 0;
}

.hero {
  --hero-pad: 1.7rem;
  display: flex;
  flex-direction: column;
  grid-column: 1;
  min-height: 32rem;
  padding: 1.45rem var(--hero-pad) 0;
  background: var(--color-welcome);
  color: var(--color-text-on-brand);
}

.hero__top,
.hero__foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.hero__mid {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 0 1.35rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.wordmark__mark {
  width: 0.7rem;
  height: 1rem;
  background: var(--color-stage);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  flex: none;
}

.wordmark__org,
.wordmark__event,
.skill,
.role,
.tile__kicker {
  display: block;
}

.wordmark__org {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.wordmark__event {
  margin-top: 0.15rem;
  color: var(--ws-ice);
  font-size: 0.84rem;
  letter-spacing: 0.03em;
}

.role {
  margin: 0;
  padding: 0.38rem 0.7rem;
  border: 1px solid var(--color-border);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.skill {
  margin: 0;
  color: var(--ws-mint);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.tile__title,
.stage,
.hero__note,
.tile__host,
.tile__open,
.tile__kicker {
  margin: 0;
}

.hero h1 {
  max-width: 9ch;
  margin-top: 0.45rem;
  font-size: clamp(3rem, 4.7vw, 4.7rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 0.9;
}

.stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-inline: calc(var(--hero-pad) * -1);
  padding: 0.85rem var(--hero-pad);
  background: var(--color-stage);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

.chevrons {
  display: flex;
  gap: 0.45rem;
  flex: none;
}

.chevrons span {
  width: 0.48rem;
  height: 0.48rem;
  border-top: 2px solid var(--ws-white);
  border-right: 2px solid var(--ws-white);
  transform: rotate(45deg);
}

.hero__foot {
  align-items: flex-end;
  padding: 1.15rem 0 1.2rem;
}

.hero__note {
  max-width: 16rem;
  color: var(--ws-ice);
  font-size: 1rem;
  line-height: 1.45;
}

.ornament {
  position: relative;
  width: 9.5rem;
  height: 7.2rem;
  flex: none;
  margin-left: auto;
}

.ornament svg {
  position: absolute;
  display: block;
  overflow: visible;
}

.ornament__wire {
  top: 0;
  left: 0;
  width: 4.6rem;
}

.ornament__solid {
  right: 0;
  bottom: 0;
  width: 5.8rem;
}

.face--top {
  fill: var(--ws-mint);
}

.face--left {
  fill: var(--ws-ice);
}

.face--right {
  fill: color-mix(in srgb, var(--ws-mint) 58%, var(--ws-navy));
}

.face--line {
  fill: none;
  stroke: var(--ws-ice);
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.tools {
  display: grid;
  grid-column: 2;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(12.5rem, 1fr);
  gap: 14px;
  align-content: stretch;
}

.tools__status {
  grid-column: 1 / -1;
  margin: 0;
  padding: 1.5rem 1.4rem;
  background: var(--ws-navy);
  color: var(--color-text-on-brand);
}

.tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 12rem;
  padding: 1.35rem 1.4rem 1.25rem;
  background: var(--tile, var(--ws-navy));
  color: var(--tile-text, var(--color-text-on-brand));
  text-decoration: none;
  position: relative;
}

.tile--wide {
  grid-column: 1 / -1;
}

.tile__kicker {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tile__title {
  max-width: 12ch;
  margin-top: auto;
  padding-top: 1.5rem;
  font-size: clamp(1.65rem, 2.3vw, 2.2rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.tile--wide .tile__title {
  max-width: 18ch;
}

.tile__host {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.tile__open {
  display: flex;
  align-items: center;
  margin-top: 1.15rem;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chev {
  width: 0.48rem;
  height: 0.48rem;
  margin-left: 0.55rem;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.tile::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--ws-white);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 180ms ease;
}

.tile:hover,
.tile:focus-visible {
  background: color-mix(in srgb, var(--tile) 86%, white);
}

.tile:hover::after,
.tile:focus-visible::after {
  transform: scaleX(1);
}

.tile:hover .chev,
.tile:focus-visible .chev {
  transform: translate(3px, -3px) rotate(45deg);
}

.tile:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  z-index: 1;
}

.tile:active {
  background: color-mix(in srgb, var(--tile) 92%, black);
}

@media (min-width: 1500px) {
  body {
    padding: 20px;
  }

  .mosaic {
    min-height: calc(100dvh - 40px);
  }
}

@media (max-width: 960px) {
  .mosaic {
    display: flex;
    flex-direction: column;
  }

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

  .tile--wide {
    grid-column: auto;
  }

  .hero,
  .tile {
    height: auto;
  }

  .hero {
    min-height: 32rem;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 14vw, 4.5rem);
  }

  .tile {
    min-height: 13.5rem;
  }
}

@media (max-width: 420px) {
  .chevrons {
    display: none;
  }

  .hero__foot {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chev,
  .tile::after {
    transition: none;
  }
}
