@font-face { font-family: "Zalando Sans"; src: url("assets/fonts/zalando-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zalando Sans"; src: url("assets/fonts/zalando-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Zalando Sans"; src: url("assets/fonts/zalando-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* World grounds. Blue is a hair darker than the avatar's #0172FE so white body text clears 4.5:1. */
  --blue: #0068f0;
  --black: #000;
  --red: #d0021b;
  --bg: var(--blue);
  --fg: #fff;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --world-ms: 520ms;
  --gutter: clamp(1.25rem, 0.8rem + 2vw, 3rem);
  color-scheme: dark;
}
:root[data-world="torch"] { --bg: var(--black); }
:root[data-world="empresa"] { --bg: var(--red); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); transition: background-color var(--world-ms) var(--ease-out); -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body {
  margin: 0;
  color: var(--fg);
  background: transparent;
  font-family: "Zalando Sans", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--fg); color: var(--bg); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.page {
  /* Fill the largest viewport so the body always runs past the bottom edge, even with browser bars collapsed */
  min-height: 100vh;
  min-height: 100lvh;
  display: flex;
  flex-direction: column;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

/* Bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-top: max(1rem, env(safe-area-inset-top));
  min-height: 3.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
}
.lang { display: flex; align-items: center; gap: 0.375rem; }
.lang button { min-width: 2.75rem; min-height: 2.75rem; font-weight: 600; }
.lang button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.3em; }
.lang span { opacity: 0.5; }

/* Stage: copy first, avatar flush with the bottom edge */
.stage { flex: 1; display: flex; flex-direction: column; }
.copy { display: flex; flex-direction: column; padding-top: clamp(1.5rem, 4svh, 3rem); }
.signature { order: 1; margin: 0; }
.worlds { order: 2; }
.panels { order: 3; }
.mail { order: 4; }

.signature::before {
  content: "";
  display: block;
  width: min(100%, 23rem);
  aspect-ratio: 1916 / 348;
  background: currentColor;
  -webkit-mask: url("assets/plates/signature.png") left center / contain no-repeat;
  mask: url("assets/plates/signature.png") left center / contain no-repeat;
  animation: draw 1.25s cubic-bezier(0.45, 0, 0.2, 1) 0.2s both;
}
@keyframes draw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* World selector */
.worlds { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-top: clamp(1.25rem, 3svh, 2rem); }
.world {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 400;
  transition: transform 160ms var(--ease-out);
}
.world:active { transform: scale(0.97); }
.world[aria-checked="true"] { font-weight: 700; }
.swatch {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75);
  transition: box-shadow 200ms var(--ease-out);
}
.world[data-world="mio"] .swatch { background: var(--blue); }
.world[data-world="torch"] .swatch { background: linear-gradient(90deg, #000 50%, #fff 50%); }
.world[data-world="empresa"] .swatch { background: linear-gradient(90deg, var(--red) 50%, #fff 50%); }
.world[aria-checked="true"] .swatch { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }

/* Panels share one cell, so switching worlds never moves the layout */
.panels { display: grid; margin-top: clamp(1.25rem, 3svh, 2rem); }
.panel { grid-area: 1 / 1; }
.js .panel[hidden] { display: block; visibility: hidden; }
.panel h2 {
  margin: 0;
  font-size: clamp(1.875rem, 1.3rem + 2.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
  max-width: 16ch;
}
.panel[data-panel="torch"] h2 { font-size: clamp(3.25rem, 2rem + 5vw, 6rem); letter-spacing: -0.04em; }
.panel p {
  margin: 0.85rem 0 0;
  font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.375rem);
  max-width: 34ch;
  text-wrap: pretty;
}
.more {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 1rem;
  min-height: 2.75rem;
  font-weight: 600;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.1875rem);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
.more::after {
  content: "";
  width: 0.95em;
  height: 0.95em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10h13M11 5l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10h13M11 5l5 5-5 5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 200ms var(--ease-out);
}
@media (hover: hover) { .more:hover::after { transform: translateX(3px); } }

.mail {
  align-self: flex-start;
  margin-top: clamp(1.25rem, 3svh, 2.25rem);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease;
}
@media (hover: hover) { .mail:hover { border-color: currentColor; } }

/* Avatar: on phones it sits under the copy, flush with the bottom edge */
.copy { order: 0; }
/* The plate's flat bottom edge always sits on the page's bottom edge, and the page fills the largest viewport, so no ground shows under the body. */
.avatar { order: 1; margin: auto 0 0; padding-top: 1.5rem; display: flex; justify-content: center; align-items: flex-end; }
.avatar img {
  width: min(88%, 24rem);
  height: auto;
  transition: filter var(--world-ms) var(--ease-out);
}
:root[data-world="torch"] .avatar img { filter: grayscale(1) contrast(1.06); }

/* Desktop: avatar left and cropped by the bottom edge, copy on the right */
@media (min-width: 900px) {
  .page { height: 100svh; min-height: 40rem; overflow: hidden; }
  .bar { padding-top: max(1.5rem, env(safe-area-inset-top)); }
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    column-gap: clamp(2rem, 4vw, 5rem);
    min-height: 0;
  }
  .avatar { grid-column: 1; grid-row: 1; margin: 0; padding: 0; align-self: end; height: 100%; min-height: 0; justify-content: flex-start; }
  .avatar img { width: auto; height: min(100%, 58rem); max-width: 100%; object-fit: contain; object-position: left bottom; }
  .copy { grid-column: 2; grid-row: 1; align-self: center; padding: 0 0 3rem; }
  .worlds { order: 0; margin: 0 0 clamp(1.5rem, 4svh, 2.5rem); }
  .signature::before { width: clamp(22rem, 34vw, 40rem); }
  .panels { margin-top: clamp(1.5rem, 3.5svh, 2.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  html, .avatar img, .swatch { transition: none; }
  .signature::before { animation: none; }
}
