/*
  Colores de marca tomados de «A Dictionary of Color Combinations» (Sanzo Wada), eligiendo las combinaciones
  más cercanas a la web de referencia: negro o papel + un único acento saturado.
    Combinación nº 340 (principal): Peach Red #f15a30 · Sea Green #00b49b · Neutral Gray #b6bfc1 · Black #111314
    Combinación nº 46  (alternativa): Orange #f37420 + Black #111314
  El acento va de relleno con texto Black (contraste 5,5:1); no usarlo para texto pequeño sobre blanco.
*/
:root {
  --bg: #ffffff;
  --fg: #111314;           /* Wada Black */
  --muted: #62676b;
  --soft: #f3f3f2;
  --line: #e5e6e6;
  --flash: #f15a30;        /* Wada Peach Red */
  --flash-ink: #111314;    /* Wada Black */
  --carmine: #b73f74;      /* Wada Rosolanc Purple */
  --diamine: #00b49b;      /* Wada Sea Green */
  --radius: 14px;
  --maxw: 1360px;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px, 3.5vw, 52px); }

/* ---------- Cabecera ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.86); backdrop-filter: saturate(1.6) blur(12px); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; letter-spacing: -0.01em; }
.brand svg { width: 26px; height: 26px; padding: 5px; border-radius: 7px; background: var(--fg); color: var(--flash); }
.nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 28px); font-size: 14px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
@media (max-width: 560px) { .nav a:nth-child(n+4) { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); display: grid; grid-template-columns: 1fr; gap: 32px; }
.hero h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.hero p.lead { margin-top: 12px; max-width: 60ch; color: var(--muted); font-size: clamp(16px, 1.5vw, 18px); }
.hero .actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 960px) {
  .hero.split { grid-template-columns: 1.3fr 1fr; align-items: center; }
}

.btn { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 10px; font-weight: 500; font-size: 15px; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.btn-dark { background: var(--fg); color: #fff; }
.btn-dark:hover { background: #2a2a30; }
.btn-ghost { background: var(--soft); }
.btn-ghost:hover { background: #e9e9ee; }
.btn-flash { background: var(--flash); color: var(--flash-ink); }
.btn:active { transform: translateY(1px); }

.hero-card { border: 1px solid var(--line); border-radius: 20px; padding: 8px; box-shadow: 0 10px 30px -12px #0002; }
.hero-card .media { aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: var(--soft); }
.hero-card .media video, .hero-card .media img { width: 100%; height: 100%; object-fit: cover; }

/* Tiras de la portada: rejilla regular */
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 980px) { .strip.four { grid-template-columns: repeat(4, 1fr); } }
.strip .card { margin: 0; min-width: 0; }
.about > *, .hero > * { min-width: 0; }
.strip .card .media { aspect-ratio: 4/5; }

/* ---------- Barra de filtros ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar .left, .toolbar .right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar .label { color: var(--muted); font-size: 15px; margin-right: 2px; }
.chip { height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .15s, border-color .15s; }
.chip:hover { border-color: #cfcfd6; }
.chip .count { color: #a3a3ad; font-size: 13px; }
.chip[aria-pressed="true"] { background: var(--fg); border-color: var(--fg); color: #fff; }
.chip[aria-pressed="true"] .count { color: #ffffff99; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-real { background: var(--diamine); }
.dot-ai { background: var(--carmine); }
.dot-estudio { background: var(--flash); box-shadow: inset 0 0 0 1.5px var(--fg); }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 22px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.select { height: 36px; border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--fg); padding: 0 4px; }
.textbtn { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; height: 36px; padding: 0 8px; border-radius: 8px; }
.textbtn:hover { background: var(--soft); }

/* ---------- Rejilla tipo masonry ---------- */
.grid { columns: 1; column-gap: 20px; }
@media (min-width: 620px)  { .grid { columns: 2; } }
@media (min-width: 980px)  { .grid { columns: 3; } }
@media (min-width: 1280px) { .grid { columns: 4; } }

.card { break-inside: avoid; margin-bottom: 22px; display: block; width: 100%; text-align: left; }
.card .media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--soft); outline: 1px solid #0000000d; outline-offset: -1px; transition: transform .25s ease, box-shadow .25s ease; }
.card:hover .media, .card:focus-visible .media { transform: translateY(-2px); box-shadow: 0 14px 30px -14px #0004; }
.card:focus-visible { outline: none; }
.card:focus-visible .media { outline: 2px solid var(--fg); }
.card .media video, .card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 2px 0; font-size: 14px; }
.card .meta .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { flex: none; font-size: 12px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.badge-kind { position: absolute; left: 10px; top: 10px; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: #000a; color: #fff; backdrop-filter: blur(6px); }

/* Ratios variados para el efecto masonry */
.r-wide { aspect-ratio: 16/9; }
.r-square { aspect-ratio: 1/1; }
.r-tall { aspect-ratio: 4/5; }
.r-story { aspect-ratio: 9/14; }

/* Marcador de posición mientras no hay archivo */
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #fff9; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.placeholder::before { content: ""; position: absolute; inset: 0; background: var(--ph, linear-gradient(135deg,#222,#555)); }
.placeholder span { position: relative; padding: 4px 10px; border: 1px solid #fff5; border-radius: 999px; }

.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- Secciones ---------- */
section.block { padding: clamp(40px, 6vw, 80px) 0; }
section.block + section.block { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.02em; }
.section-head p { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.section-head a { font-size: 14px; white-space: nowrap; }

.about { display: grid; gap: 28px; }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1fr; align-items: center; } }
.about .text { font-size: clamp(18px, 2vw, 22px); line-height: 1.5; letter-spacing: -0.01em; }
.about .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.stat { background: var(--soft); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 24px; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }

.contact-box { background: var(--fg); color: #fff; border-radius: 22px; padding: clamp(28px, 5vw, 56px); display: grid; gap: 20px; }
@media (min-width: 860px) { .contact-box { grid-template-columns: 1.3fr 1fr; align-items: center; } }
.contact-box h2 { font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -0.03em; font-weight: 600; line-height: 1.1; }
.contact-box p { color: #ffffffaa; margin-top: 10px; }
.contact-box .lines { display: grid; gap: 8px; font-size: 15px; }
.contact-box .lines a { color: #fff; }

.site-footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* ---------- Ficha (modal) ---------- */
dialog.viewer { border: 0; padding: 0; width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 20px; margin: auto; background: #fff; color: var(--fg); overflow: auto; }
dialog.viewer::backdrop { background: #0009; backdrop-filter: blur(6px); }
.viewer-grid { display: grid; }
@media (min-width: 900px) { .viewer-grid { grid-template-columns: 1.6fr 1fr; } }
.viewer .stage { background: #0b0b0e; display: grid; place-items: center; min-height: 260px; position: relative; }
.viewer .stage video, .viewer .stage img { max-height: 78vh; width: 100%; object-fit: contain; }
.viewer .stage .placeholder { position: relative; inset: auto; width: 100%; aspect-ratio: 16/9; }
.viewer .info { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.viewer .info h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; padding-right: 36px; }
.viewer .close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; z-index: 2; }
.viewer .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer .field { display: grid; gap: 6px; }
.viewer .field .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.viewer pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55; background: var(--soft); border-radius: 10px; padding: 12px 14px; }
.viewer .copy { align-self: start; }
.viewer .fmt { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 900px) { dialog.viewer.vertical .viewer-grid { grid-template-columns: 1fr 1fr; } }
dialog.viewer.vertical .stage video { max-height: calc(100vh - 64px); }

/* ---------- Paletas Wada ---------- */
.swatches { display: flex; border-radius: 10px; overflow: hidden; height: 56px; outline: 1px solid #0000000f; outline-offset: -1px; }
.swatches .sw { flex: 1; position: relative; }
.swatch-list { display: grid; gap: 6px; }
.swatch-row { display: flex; align-items: center; gap: 10px; font-size: 14px; text-align: left; padding: 2px 0; }
.swatch-row i { width: 22px; height: 22px; border-radius: 6px; flex: none; outline: 1px solid #0000001a; outline-offset: -1px; }
.swatch-row code { margin-left: auto; color: var(--muted); font-size: 13px; }
.swatch-row:hover code { color: var(--fg); }

.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.pal { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 10px; background: #fff; }
.pal .swatches { height: 120px; }
.pal .head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.pal .head b { font-weight: 600; }
.pal .names { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pal .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pal .actions button { font-size: 12px; padding: 5px 10px; border-radius: 7px; background: var(--soft); }
.pal .actions button:hover { background: #e7e8e8; }
.pal.brand { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.search { height: 36px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; font: inherit; font-size: 14px; min-width: 220px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Audios: carátula (si la hay) y onda */
.audio-card { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.audio-card::before { content: ""; position: absolute; inset: 0; background: var(--ph, linear-gradient(135deg,#222,#555)); }
.audio-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.audio-card .wave { position: relative; width: 56%; max-width: 260px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.audio-card audio { position: absolute; left: 16px; right: 16px; bottom: 16px; width: calc(100% - 32px); }
.site-footer .admin-link { margin-left: auto; font-size: 13px; }
.site-footer .admin-link:hover { color: var(--fg); }

/* ---------- Cuenta de usuario y prompts bajo llave ---------- */
.nav-account { height: 32px; padding: 0 14px; border-radius: 999px; background: var(--fg); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.nav-account:hover { background: #2a2a30; }
.nav-account.in { background: var(--soft); color: var(--fg); }
.nav-account.in::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--diamine); margin-right: 7px; }
.viewer .prompt-slot { display: grid; gap: 16px; }
.viewer .prompt-slot:empty { display: none; }
.viewer .prompt-slot .copy { justify-self: start; }
.viewer pre.loading { color: var(--muted); }
.viewer .field.locked { border: 1px dashed #cfd1d2; border-radius: 12px; padding: 14px; gap: 10px; }
.viewer .field.locked p { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.viewer .field.locked svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--flash); }
.viewer .field.locked .row { display: flex; flex-wrap: wrap; gap: 8px; }
.viewer .field.locked .btn { height: 40px; padding: 0 16px; font-size: 14px; }
.muted { color: var(--muted); }

dialog.account { border: 0; padding: 0; width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border-radius: 20px; margin: auto; background: #fff; color: var(--fg); overflow: auto; }
dialog.account::backdrop { background: #0009; backdrop-filter: blur(6px); }
.account .close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; }
.account-body { padding: 28px 24px 24px; display: grid; gap: 14px; }
.account h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; padding-right: 40px; }
.account p { font-size: 14px; line-height: 1.5; }
.account form { display: grid; gap: 12px; }
.account .ts { display: contents; }   /* captcha: no ocupa sitio mientras no se ve */
.account .error.wait { color: var(--muted); }   /* «comprobando…» o «marca la casilla»: un aviso, no un error */
.account p.legal { font-size: 12px; line-height: 1.45; color: var(--muted); }   /* información básica de protección de datos junto al formulario */
.account p.legal a { color: inherit; }
.account label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.account input[type="text"], .account input[type="email"], .account input[type="password"] { height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 16px; color: var(--fg); background: #fff; }
.account input:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; border-color: transparent; }
.account input, .account select, .account textarea { width: 100%; min-width: 0; box-sizing: border-box; }
.account label.check { display: flex; gap: 10px; align-items: flex-start; color: var(--fg); font-size: 14px; line-height: 1.45; }
.account label.check input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--fg); }
.account label.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.account .error { color: #c2281c; min-height: 0; }
.account .error:empty { display: none; }
.account .btn { justify-content: center; }
.account .btn[disabled] { opacity: .6; pointer-events: none; }
.account .btn-danger { background: #c2281c; color: #fff; }
.account .switch button, .account a { text-decoration: underline; text-underline-offset: 3px; color: var(--fg); font-weight: 500; }
.account .who { display: grid; gap: 2px; background: var(--soft); border-radius: 12px; padding: 12px 14px; }
.account .who span { color: var(--muted); }
.account details { border-top: 1px solid var(--line); padding-top: 12px; }
.account summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.account details form { margin-top: 12px; }

/* ---------- Página de texto (privacidad) ---------- */
.prose { max-width: 68ch; padding: clamp(32px, 6vw, 72px) 0; display: grid; gap: 14px; }
.prose h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.prose h2 { font-size: 18px; font-weight: 600; margin-top: 14px; }
.prose p, .prose li { color: #3c4043; line-height: 1.6; }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) {
  .site-header .wrap { gap: 10px; }
  .nav { gap: 11px; font-size: 13.5px; }
  .nav-account { height: 30px; padding: 0 11px; font-size: 13px; }
}
@media (max-width: 400px) { .nav a:nth-child(n+3) { display: none; } }

/* ---------- Presupuesto, compartir y página propia de cada pieza ---------- */
.piece-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.piece-actions .btn { height: 42px; padding: 0 18px; }
.piece-actions svg { width: 18px; height: 18px; }
dialog.quote { width: min(480px, calc(100vw - 32px)); }
.account select, .account textarea { border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 16px; color: var(--fg); background: #fff; }
.account select { height: 44px; padding: 0 10px; }
.account textarea { padding: 10px 12px; resize: vertical; min-height: 96px; line-height: 1.45; }
.account select:focus-visible, .account textarea:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; border-color: transparent; }
.account .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.account .ref { display: grid; gap: 2px; background: var(--soft); border-radius: 12px; padding: 10px 14px; }
.account .ref span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.crumbs { padding: 22px 0 14px; font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.viewer.piece { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #fff; }
.viewer.piece .info h1 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.viewer.piece .stage video, .viewer.piece .stage img { max-height: 80vh; }
.viewer.piece .stage audio { width: calc(100% - 32px); }
@media (min-width: 900px) { .viewer.piece.vertical .viewer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .account .two { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 900px) {
  .viewer.piece { overflow: visible; }
  .viewer.piece .viewer-grid { align-items: start; }
  .viewer.piece .stage { position: sticky; top: 80px; min-height: 0; border-radius: 19px 0 0 19px; overflow: hidden; }
}
