/* apps.santi.tools · minimal. Same family as santi.tools: dark ground, Switzer, lowercase chrome.
   Each app brings one accent (--accent, set per page/section). Themes only hold that accent. */
@font-face { font-family: Switzer; src: url('/assets/fonts/switzer-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Switzer; src: url('/assets/fonts/switzer-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #111110; --fg: #eceae4; --muted: #a7a49b; --line: rgba(236, 234, 228, 0.12);
  --text: var(--fg); --accent: var(--fg);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: clamp(18px, 3.2vw, 40px);
  --r: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
html:not([lang='es']):not(.i18n-ready) body { visibility: hidden; }
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font: 400 15px/1.55 Switzer, ui-sans-serif, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
::selection { background: var(--accent); color: var(--bg); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }

/* lowercase everywhere except legal text */
.bar, .home main, .page main, .foot, .docpage .back { text-transform: lowercase; }

/* ---------- tiny menu ---------- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 20px;
  height: 44px; padding: 0 var(--pad);
  font-size: 12px; letter-spacing: 0.01em; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bar a, .bar button { white-space: nowrap; display: inline-flex; align-items: center; min-height: 28px; transition: color 0.3s var(--ease); }
.crumbs { display: flex; gap: 7px; align-items: center; }
.crumbs span { opacity: 0.5; }
.menu { display: flex; gap: 16px; margin-left: auto; }
.menu a { position: relative; gap: 6px; }
.menu a::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0; scale: 0; transition: opacity 0.3s var(--ease), scale 0.4s var(--ease); }
.bar a[aria-current='page'] { color: var(--fg); }
.menu a[aria-current='page']::before { opacity: 1; scale: 1; }
.lang-toggle { display: flex; gap: 2px; }
.lang-toggle button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; min-width: 24px; justify-content: center; }
.lang-toggle button[aria-pressed='true'] { color: var(--fg); }
@media (hover: hover) {
  .bar a:hover, .lang-toggle button:hover { color: var(--fg); }
  .menu a:hover::before { opacity: 1; scale: 1; }
}

.label { font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0.01em; }
.meta { font-size: 12px; color: var(--muted); }

/* link: underline that draws, arrow that travels (same as santi.tools) */
.lnk { display: inline-flex; align-items: center; gap: 0.4em; min-height: 32px; color: var(--muted); transition: color 0.35s var(--ease); }
.lnk-t { position: relative; }
.lnk-t::after { content: ''; position: absolute; left: 0; right: 0; bottom: -0.1em; height: 1px; background: var(--accent); transform-origin: 0 50%; scale: 0 1; transition: scale 0.5s var(--ease); }
.arr { width: 0.75em; height: 0.75em; opacity: 0; translate: -5px 5px; transition: opacity 0.35s var(--ease), translate 0.45s var(--ease); }
.arr path { fill: none; stroke: currentColor; stroke-width: 1.4; }
.lnk:focus-visible { color: var(--fg); }
.lnk:focus-visible .lnk-t::after, .lnk:focus-visible .arr { scale: 1 1; opacity: 1; translate: 0 0; }
@media (hover: hover) {
  .lnk:hover { color: var(--fg); }
  .lnk:hover .lnk-t::after { scale: 1 1; }
  .lnk:hover .arr { opacity: 1; translate: 0 0; }
}

/* ---------- shots ---------- */
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.4vw, 18px); align-items: start; }
.shots img { width: 100%; border-radius: var(--r); background: #1b1a18; }

/* ---------- home ---------- */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.home main { padding-top: clamp(8px, 3vh, 32px); }
.app {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 96px);
  align-items: center; padding: clamp(48px, 9vh, 104px) 0;
}
.app + .app { border-top: 1px solid var(--line); }
.app-text { display: grid; gap: 12px; justify-items: start; max-width: 40ch; }
.app h2 { font-size: clamp(30px, 1.6rem + 1.6vw, 46px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.02; }
.name { display: inline-flex; align-items: center; gap: 0.32em; transition: color 0.6s var(--ease); }
.name::before { content: ''; width: 0.22em; height: 0.22em; border-radius: 50%; background: var(--accent); scale: 0.6; opacity: 0.35; transition: scale 0.6s var(--ease), opacity 0.6s var(--ease); }
.app .tag { font-size: 17px; line-height: 1.35; }
.app .desc { color: var(--muted); }
.app .meta { margin-top: 4px; }
.app .lnk { margin-top: 2px; }
.js .app .shots img { filter: grayscale(1) brightness(0.62); transition: filter 0.9s var(--ease), translate 0.9s var(--ease); }
.js .app.on .shots img { filter: none; }
.js .app.on .shots img:nth-child(2) { translate: 0 -10px; }
.js .app.on .name::before { scale: 1; opacity: 1; }
@media (hover: hover) { .name:hover { color: var(--accent); } }

/* ---------- app page ---------- */
.hero { display: grid; gap: 14px; justify-items: start; padding: clamp(40px, 9vh, 96px) 0 clamp(36px, 6vh, 64px); }
.hero .icon { width: 56px; height: 56px; border-radius: 13px; margin-bottom: 6px; }
.hero h1 { font-size: clamp(40px, 1.8rem + 4vw, 84px); font-weight: 500; letter-spacing: -0.045em; line-height: 0.95; }
.hero .tag { font-size: 18px; line-height: 1.35; max-width: 40ch; }
.hero .lead, .hero .tag { max-width: 46ch; }
.hero .lead { color: var(--muted); font-size: 16px; }
.hero .lead b { font-weight: 500; }
.shots-4 { grid-template-columns: repeat(4, 1fr); }
.feats { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 64px; padding: clamp(56px, 10vh, 112px) 0; }
.feats .label { grid-column: 1; }
.feats .intro, .feats dl, .feats .note { grid-column: 2; }
.feats .intro { color: var(--muted); max-width: 56ch; }
.feats dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.feat { padding: 16px 0; border-top: 1px solid var(--line); }
.feat dt { font-weight: 500; }
.feat dt small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.feat dd { color: var(--muted); margin-top: 2px; }
.feats .note { font-size: 12px; color: var(--muted); }

/* ---------- doc pages ---------- */
.doc { max-width: 680px; margin: 0 auto; padding: clamp(40px, 9vh, 96px) 0 clamp(56px, 10vh, 112px); }
.doc header { display: grid; gap: 14px; justify-items: start; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.back { display: inline-flex; align-items: center; gap: 10px; min-height: 32px; font-size: 12px; color: var(--muted); transition: color 0.3s var(--ease); }
.back img { width: 24px; height: 24px; border-radius: 6px; }
@media (hover: hover) { .back:hover { color: var(--fg); } }
.doc h1 { font-size: clamp(30px, 1.4rem + 2vw, 44px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; }
.doc .eff { font-size: 12px; color: var(--muted); }
.doc .intro { font-size: 17px; line-height: 1.5; }
.doc section { padding-top: 32px; scroll-margin-top: 60px; }
.doc h2 { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.doc section > div { color: #cfccc4; }
.doc p + p, .doc p + ul, .doc ul + p, .doc p + ol, .doc p + table, .doc table + p { margin-top: 10px; }
.doc ul, .doc ol { padding-left: 1.2em; display: grid; gap: 6px; }
.doc b, .doc strong { color: var(--fg); font-weight: 500; }
.doc section a, .doc .intro a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
@media (hover: hover) { .doc section a:hover, .doc .intro a:hover { color: var(--fg); } }
.doc code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-weight: 500; color: var(--fg); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 24px var(--pad) 28px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.foot-links { display: flex; gap: 16px; }
.foot a { display: inline-flex; align-items: center; min-height: 24px; transition: color 0.3s var(--ease); }
@media (hover: hover) { .foot a:hover { color: var(--fg); } }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .bar { gap: 10px; padding: 0 16px; }
  .bar .crumbs a:first-child, .bar .crumbs span { display: none; }
  .menu { gap: 10px; }
  .app { grid-template-columns: 1fr; gap: 24px; }
  .shots, .shots-4 {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); scroll-padding: 0 var(--pad);
  }
  .shots::-webkit-scrollbar { display: none; }
  .shots img { scroll-snap-align: start; }
  .js .app.on .shots img:nth-child(2) { translate: none; }
  .feats { grid-template-columns: 1fr; gap: 16px; }
  .feats .label, .feats .intro, .feats dl, .feats .note { grid-column: 1; }
  .feats dl { grid-template-columns: 1fr; }
}
@media (max-width: 370px) { .bar .crumbs { display: none; } .menu { gap: 8px; margin-left: 0; } .bar { gap: 8px; padding: 0 12px; justify-content: space-between; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .app.on .shots img:nth-child(2) { translate: none; }
}
